home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / shlobj.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  128.7 KB  |  3,510 lines

  1. //===========================================================================
  2. //
  3. // Copyright (c) Microsoft Corporation 1991-1997
  4. //
  5. // File: shlobj.h
  6. //
  7. //===========================================================================
  8.  
  9. #ifndef _SHLOBJ_H_
  10. #define _SHLOBJ_H_
  11. #pragma option push -b
  12.  
  13. #ifndef SNDMSG
  14. #ifdef __cplusplus
  15. #define SNDMSG ::SendMessage
  16. #else
  17. #define SNDMSG SendMessage
  18. #endif
  19. #endif // ifndef SNDMSG
  20.  
  21. //
  22. // Define API decoration for direct importing of DLL references.
  23. //
  24. #ifndef WINSHELLAPI
  25. #if !defined(_SHELL32_)
  26. #define WINSHELLAPI       DECLSPEC_IMPORT
  27. #else
  28. #define WINSHELLAPI
  29. #endif
  30. #endif // WINSHELLAPI
  31.  
  32. #ifndef SHSTDAPI
  33. #if !defined(_SHELL32_)
  34. #define SHSTDAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  35. #define SHSTDAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  36. #else
  37. #define SHSTDAPI          STDAPI
  38. #define SHSTDAPI_(type)   STDAPI_(type)
  39. #endif
  40. #endif // SHSTDAPI
  41.  
  42. #ifndef SHDOCAPI
  43. #if !defined(_SHDOCVW_)
  44. #define SHDOCAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  45. #define SHDOCAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  46. #else
  47. #define SHDOCAPI          STDAPI
  48. #define SHDOCAPI_(type)   STDAPI_(type)
  49. #endif
  50. #endif // SHDOCAPI
  51.  
  52.  
  53. #include <ole2.h>
  54. #ifndef _PRSHT_H_
  55. #include <prsht.h>
  56. #endif
  57. #ifndef _INC_COMMCTRL
  58. #include <commctrl.h>   // for LPTBBUTTON
  59. #endif
  60.  
  61. #ifndef INITGUID
  62. #include <shlguid.h>
  63. #endif /* !INITGUID */
  64.  
  65. #ifndef RC_INVOKED
  66. #pragma pack(1)         /* Assume byte packing throughout */
  67. #endif /* !RC_INVOKED */
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {            /* Assume C declarations for C++ */
  71. #endif /* __cplusplus */
  72.  
  73.  
  74. //===========================================================================
  75. //
  76. // Object identifiers in the explorer's name space (ItemID and IDList)
  77. //
  78. //  All the items that the user can browse with the explorer (such as files,
  79. // directories, servers, work-groups, etc.) has an identifier which is unique
  80. // among items within the parent folder. Those identifiers are called item
  81. // IDs (SHITEMID). Since all its parent folders have their own item IDs,
  82. // any items can be uniquely identified by a list of item IDs, which is called
  83. // an ID list (ITEMIDLIST).
  84. //
  85. //  ID lists are almost always allocated by the task allocator (see some
  86. // description below as well as OLE 2.0 SDK) and may be passed across
  87. // some of shell interfaces (such as IShellFolder). Each item ID in an ID list
  88. // is only meaningful to its parent folder (which has generated it), and all
  89. // the clients must treat it as an opaque binary data except the first two
  90. // bytes, which indicates the size of the item ID.
  91. //
  92. //  When a shell extension -- which implements the IShellFolder interace --
  93. // generates an item ID, it may put any information in it, not only the data
  94. // with that it needs to identifies the item, but also some additional
  95. // information, which would help implementing some other functions efficiently.
  96. // For example, the shell's IShellFolder implementation of file system items
  97. // stores the primary (long) name of a file or a directory as the item
  98. // identifier, but it also stores its alternative (short) name, size and date
  99. // etc.
  100. //
  101. //  When an ID list is passed to one of shell APIs (such as SHGetPathFromIDList),
  102. // it is always an absolute path -- relative from the root of the name space,
  103. // which is the desktop folder. When an ID list is passed to one of IShellFolder
  104. // member function, it is always a relative path from the folder (unless it
  105. // is explicitly specified).
  106. //
  107. //===========================================================================
  108.  
  109. //
  110. // SHITEMID -- Item ID
  111. //
  112. typedef struct _SHITEMID        // mkid
  113. {
  114.     USHORT      cb;             // Size of the ID (including cb itself)
  115.     BYTE        abID[1];        // The item ID (variable length)
  116. } SHITEMID;
  117. typedef UNALIGNED SHITEMID *LPSHITEMID;
  118. typedef const UNALIGNED SHITEMID *LPCSHITEMID;
  119.  
  120. //
  121. // ITEMIDLIST -- List if item IDs (combined with 0-terminator)
  122. //
  123. typedef struct _ITEMIDLIST      // idl
  124. {
  125.     SHITEMID    mkid;
  126. } ITEMIDLIST;
  127. typedef UNALIGNED ITEMIDLIST * LPITEMIDLIST;
  128. typedef const UNALIGNED ITEMIDLIST * LPCITEMIDLIST;
  129.  
  130.  
  131. //===========================================================================
  132. //
  133. // Task allocator API
  134. //
  135. //  All the shell extensions MUST use the task allocator (see OLE 2.0
  136. // programming guild for its definition) when they allocate or free
  137. // memory objects (mostly ITEMIDLIST) that are returned across any
  138. // shell interfaces. There are two ways to access the task allocator
  139. // from a shell extension depending on whether or not it is linked with
  140. // OLE32.DLL or not (purely for efficiency).
  141. //
  142. // (1) A shell extension which calls any OLE API (i.e., linked with
  143. //  OLE32.DLL) should call OLE's task allocator (by retrieving
  144. //  the task allocator by calling CoGetMalloc API).
  145. //
  146. // (2) A shell extension which does not call any OLE API (i.e., not linked
  147. //  with OLE32.DLL) should call the shell task allocator API (defined
  148. //  below), so that the shell can quickly loads it when OLE32.DLL is not
  149. //  loaded by any application at that point.
  150. //
  151. // Notes:
  152. //  In next version of Windowso release, SHGetMalloc will be replaced by
  153. // the following macro.
  154. //
  155. // #define SHGetMalloc(ppmem)   CoGetMalloc(MEMCTX_TASK, ppmem)
  156. //
  157. //===========================================================================
  158.  
  159. WINSHELLAPI HRESULT WINAPI SHGetMalloc(LPMALLOC * ppMalloc);
  160.  
  161.  
  162. //===========================================================================
  163. //
  164. // IContextMenu interface
  165. //
  166. // [OverView]
  167. //
  168. //  The shell uses the IContextMenu interface in following three cases.
  169. //
  170. // case-1: The shell is loading context menu extensions.
  171. //
  172. //   When the user clicks the right mouse button on an item within the shell's
  173. //  name space (i.g., file, directory, server, work-group, etc.), it creates
  174. //  the default context menu for its type, then loads context menu extensions
  175. //  that are registered for that type (and its base type) so that they can
  176. //  add extra menu items. Those context menu extensions are registered at
  177. //  HKCR\{ProgID}\shellex\ContextMenuHandlers.
  178. //
  179. // case-2: The shell is retrieving a context menu of sub-folders in extended
  180. //   name-space.
  181. //
  182. //   When the explorer's name space is extended by name space extensions,
  183. //  the shell calls their IShellFolder::GetUIObjectOf to get the IContextMenu
  184. //  objects when it creates context menus for folders under those extended
  185. //  name spaces.
  186. //
  187. // case-3: The shell is loading non-default drag and drop handler for directories.
  188. //
  189. //   When the user performed a non-default drag and drop onto one of file
  190. //  system folders (i.e., directories), it loads shell extensions that are
  191. //  registered at HKCR\{ProgID}\DragDropHandlers.
  192. //
  193. //
  194. // [Member functions]
  195. //
  196. //
  197. // IContextMenu::QueryContextMenu
  198. //
  199. //   This member function may insert one or more menuitems to the specified
  200. //  menu (hmenu) at the specified location (indexMenu which is never be -1).
  201. //  The IDs of those menuitem must be in the specified range (idCmdFirst and
  202. //  idCmdLast). It returns the maximum menuitem ID offset (ushort) in the
  203. //  'code' field (low word) of the scode.
  204. //
  205. //   The uFlags specify the context. It may have one or more of following
  206. //  flags.
  207. //
  208. //  CMF_DEFAULTONLY: This flag is passed if the user is invoking the default
  209. //   action (typically by double-clicking, case 1 and 2 only). Context menu
  210. //   extensions (case 1) should not add any menu items, and returns NOERROR.
  211. //
  212. //  CMF_VERBSONLY: The explorer passes this flag if it is constructing
  213. //   a context menu for a short-cut object (case 1 and case 2 only). If this
  214. //   flag is passed, it should not add any menu-items that is not appropriate
  215. //   from a short-cut.
  216. //    A good example is the "Delete" menuitem, which confuses the user
  217. //   because it is not clear whether it deletes the link source item or the
  218. //   link itself.
  219. //
  220. //  CMF_EXPLORER: The explorer passes this flag if it has the left-side pane
  221. //   (case 1 and 2 only). Context menu extensions should ignore this flag.
  222. //
  223. //   High word (16-bit) are reserved for context specific communications
  224. //  and the rest of flags (13-bit) are reserved by the system.
  225. //
  226. //
  227. // IContextMenu::InvokeCommand
  228. //
  229. //   This member is called when the user has selected one of menuitems that
  230. //  are inserted by previous QueryContextMenu member. In this case, the
  231. //  LOWORD(lpici->lpVerb) contains the menuitem ID offset (menuitem ID -
  232. //  idCmdFirst).
  233. //
  234. //   This member function may also be called programmatically. In such a case,
  235. //  lpici->lpVerb specifies the canonical name of the command to be invoked,
  236. //  which is typically retrieved by GetCommandString member previously.
  237. //
  238. //  Parameters in lpci:
  239. //    cbSize -- Specifies the size of this structure (sizeof(*lpci))
  240. //    hwnd   -- Specifies the owner window for any message/dialog box.
  241. //    fMask  -- Specifies whether or not dwHotkey/hIcon paramter is valid.
  242. //    lpVerb -- Specifies the command to be invoked.
  243. //    lpParameters -- Parameters (optional)
  244. //    lpDirectory  -- Working directory (optional)
  245. //    nShow -- Specifies the flag to be passed to ShowWindow (SW_*).
  246. //    dwHotKey -- Hot key to be assigned to the app after invoked (optional).
  247. //    hIcon -- Specifies the icon (optional).
  248. //    hMonitor -- Specifies the default monitor (optional).
  249. //
  250. //
  251. // IContextMenu::GetCommandString
  252. //
  253. //   This member function is called by the explorer either to get the
  254. //  canonical (language independent) command name (uFlags == GCS_VERB) or
  255. //  the help text ((uFlags & GCS_HELPTEXT) != 0) for the specified command.
  256. //  The retrieved canonical string may be passed to its InvokeCommand
  257. //  member function to invoke a command programmatically. The explorer
  258. //  displays the help texts in its status bar; therefore, the length of
  259. //  the help text should be reasonably short (<40 characters).
  260. //
  261. //  Parameters:
  262. //   idCmd -- Specifies menuitem ID offset (from idCmdFirst)
  263. //   uFlags -- Either GCS_VERB or GCS_HELPTEXT
  264. //   pwReserved -- Reserved (must pass NULL when calling, must ignore when called)
  265. //   pszName -- Specifies the string buffer.
  266. //   cchMax -- Specifies the size of the string buffer.
  267. //
  268. //===========================================================================
  269.  
  270. // QueryContextMenu uFlags
  271. #define CMF_NORMAL              0x00000000
  272. #define CMF_DEFAULTONLY         0x00000001
  273. #define CMF_VERBSONLY           0x00000002
  274. #define CMF_EXPLORE             0x00000004
  275. #define CMF_NOVERBS             0x00000008
  276. #define CMF_CANRENAME           0x00000010
  277. #define CMF_NODEFAULT           0x00000020
  278. #define CMF_INCLUDESTATIC       0x00000040
  279. #define CMF_RESERVED            0xffff0000      // View specific
  280.  
  281. // GetCommandString uFlags
  282. #define GCS_VERBA        0x00000000     // canonical verb
  283. #define GCS_HELPTEXTA    0x00000001     // help text (for status bar)
  284. #define GCS_VALIDATEA    0x00000002     // validate command exists
  285. #define GCS_VERBW        0x00000004     // canonical verb (unicode)
  286. #define GCS_HELPTEXTW    0x00000005     // help text (unicode version)
  287. #define GCS_VALIDATEW    0x00000006     // validate command exists (unicode)
  288. #define GCS_UNICODE      0x00000004     // for bit testing - Unicode string
  289.  
  290. #ifdef UNICODE
  291. #define GCS_VERB        GCS_VERBW
  292. #define GCS_HELPTEXT    GCS_HELPTEXTW
  293. #define GCS_VALIDATE    GCS_VALIDATEW
  294. #else
  295. #define GCS_VERB        GCS_VERBA
  296. #define GCS_HELPTEXT    GCS_HELPTEXTA
  297. #define GCS_VALIDATE    GCS_VALIDATEA
  298. #endif
  299.  
  300. #define CMDSTR_NEWFOLDERA   "NewFolder"
  301. #define CMDSTR_VIEWLISTA    "ViewList"
  302. #define CMDSTR_VIEWDETAILSA "ViewDetails"
  303. #define CMDSTR_NEWFOLDERW   L"NewFolder"
  304. #define CMDSTR_VIEWLISTW    L"ViewList"
  305. #define CMDSTR_VIEWDETAILSW L"ViewDetails"
  306.  
  307. #ifdef UNICODE
  308. #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERW
  309. #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTW
  310. #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSW
  311. #else
  312. #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERA
  313. #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTA
  314. #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSA
  315. #endif
  316.  
  317. #define CMIC_MASK_HOTKEY        SEE_MASK_HOTKEY
  318. #define CMIC_MASK_ICON          SEE_MASK_ICON
  319. #define CMIC_MASK_FLAG_NO_UI    SEE_MASK_FLAG_NO_UI
  320. #define CMIC_MASK_UNICODE       SEE_MASK_UNICODE
  321. #define CMIC_MASK_NO_CONSOLE    SEE_MASK_NO_CONSOLE
  322. #define CMIC_MASK_HASLINKNAME   SEE_MASK_HASLINKNAME
  323. #define CMIC_MASK_FLAG_SEP_VDM  SEE_MASK_FLAG_SEPVDM
  324. #define CMIC_MASK_HASTITLE      SEE_MASK_HASTITLE
  325. #define CMIC_MASK_ASYNCOK       SEE_MASK_ASYNCOK
  326.  
  327. #if (_WIN32_IE >= 0x0400)
  328. #define CMIC_MASK_PTINVOKE      0x20000000
  329. #endif
  330.  
  331.  
  332. //NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor 
  333. typedef struct _CMINVOKECOMMANDINFO {
  334.     DWORD cbSize;        // sizeof(CMINVOKECOMMANDINFO)
  335.     DWORD fMask;         // any combination of CMIC_MASK_*
  336.     HWND hwnd;           // might be NULL (indicating no owner window)
  337.     LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
  338.     LPCSTR lpParameters; // might be NULL (indicating no parameter)
  339.     LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
  340.     int nShow;           // one of SW_ values for ShowWindow() API
  341.  
  342.     DWORD dwHotKey;
  343.     HANDLE hIcon;
  344. } CMINVOKECOMMANDINFO,  *LPCMINVOKECOMMANDINFO;
  345.  
  346. typedef struct _CMInvokeCommandInfoEx {
  347.     DWORD cbSize;        // must be sizeof(CMINVOKECOMMANDINFOEX)
  348.     DWORD fMask;         // any combination of CMIC_MASK_*
  349.     HWND hwnd;           // might be NULL (indicating no owner window)
  350.     LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
  351.     LPCSTR lpParameters; // might be NULL (indicating no parameter)
  352.     LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
  353.     int nShow;           // one of SW_ values for ShowWindow() API
  354.  
  355.     DWORD dwHotKey;
  356.     
  357.     HANDLE hIcon;
  358.     LPCSTR lpTitle;      // For CreateProcess-StartupInfo.lpTitle
  359.     LPCWSTR lpVerbW;        // Unicode verb (for those who can use it)
  360.     LPCWSTR lpParametersW;  // Unicode parameters (for those who can use it)
  361.     LPCWSTR lpDirectoryW;   // Unicode directory (for those who can use it)
  362.     LPCWSTR lpTitleW;       // Unicode title (for those who can use it)
  363. #if (_WIN32_IE >= 0x0400)
  364.     POINT   ptInvoke;       // Point where it's invoked
  365. #endif
  366. } CMINVOKECOMMANDINFOEX,  *LPCMINVOKECOMMANDINFOEX;
  367.  
  368. #undef  INTERFACE
  369. #define INTERFACE   IContextMenu
  370.  
  371. DECLARE_INTERFACE_(IContextMenu, IUnknown)
  372. {
  373.     // *** IUnknown methods ***
  374.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  375.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  376.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  377.  
  378.     STDMETHOD(QueryContextMenu)(THIS_
  379.                                 HMENU hmenu,
  380.                                 UINT indexMenu,
  381.                                 UINT idCmdFirst,
  382.                                 UINT idCmdLast,
  383.                                 UINT uFlags) PURE;
  384.  
  385.     STDMETHOD(InvokeCommand)(THIS_
  386.                              LPCMINVOKECOMMANDINFO lpici) PURE;
  387.  
  388.     STDMETHOD(GetCommandString)(THIS_
  389.                                 UINT        idCmd,
  390.                                 UINT        uType,
  391.                                 UINT      * pwReserved,
  392.                                 LPSTR       pszName,
  393.                                 UINT        cchMax) PURE;
  394. };
  395.  
  396. typedef IContextMenu *  LPCONTEXTMENU;
  397.  
  398. //
  399. // IContextMenu2 (IContextMenu with one new member)
  400. //
  401. // IContextMenu2::HandleMenuMsg
  402. //
  403. //  This function is called, if the client of IContextMenu is aware of
  404. // IContextMenu2 interface and receives one of following messages while
  405. // it is calling TrackPopupMenu (in the window proc of hwndOwner):
  406. //      WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM
  407. //  The callee may handle these messages to draw owner draw menuitems.
  408. //
  409.  
  410. #undef  INTERFACE
  411. #define INTERFACE   IContextMenu2
  412.  
  413. DECLARE_INTERFACE_(IContextMenu2, IContextMenu)
  414. {
  415.     // *** IUnknown methods ***
  416.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  417.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  418.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  419.  
  420.     // *** IContextMenu methods ***
  421.     
  422.     STDMETHOD(QueryContextMenu)(THIS_
  423.                                 HMENU hmenu,
  424.                                 UINT indexMenu,
  425.                                 UINT idCmdFirst,
  426.                                 UINT idCmdLast,
  427.                                 UINT uFlags) PURE;
  428.  
  429.     STDMETHOD(InvokeCommand)(THIS_
  430.                              LPCMINVOKECOMMANDINFO lpici) PURE;
  431.  
  432.     STDMETHOD(GetCommandString)(THIS_
  433.                                 UINT        idCmd,
  434.                                 UINT        uType,
  435.                                 UINT      * pwReserved,
  436.                                 LPSTR       pszName,
  437.                                 UINT        cchMax) PURE;
  438.  
  439.     // *** IContextMenu2 methods ***
  440.     
  441.     STDMETHOD(HandleMenuMsg)(THIS_
  442.                              UINT uMsg,
  443.                              WPARAM wParam,
  444.                              LPARAM lParam) PURE;
  445. };
  446.  
  447. typedef IContextMenu2 * LPCONTEXTMENU2;
  448.  
  449. //
  450. // IContextMenu3 (IContextMenu with one new member)
  451. //
  452. // IContextMenu3::HandleMenuMsg2
  453. //
  454. //  This function is called, if the client of IContextMenu is aware of
  455. // IContextMenu3 interface and receives a menu message while
  456. // it is calling TrackPopupMenu (in the window proc of hwndOwner):
  457. //
  458.  
  459. #undef  INTERFACE
  460. #define INTERFACE   IContextMenu3
  461.  
  462. DECLARE_INTERFACE_(IContextMenu3, IContextMenu2)
  463. {
  464.     // *** IUnknown methods ***
  465.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  466.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  467.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  468.  
  469.     // *** IContextMenu methods ***
  470.     
  471.     STDMETHOD(QueryContextMenu)(THIS_
  472.                                 HMENU hmenu,
  473.                                 UINT indexMenu,
  474.                                 UINT idCmdFirst,
  475.                                 UINT idCmdLast,
  476.                                 UINT uFlags) PURE;
  477.  
  478.     STDMETHOD(InvokeCommand)(THIS_
  479.                              LPCMINVOKECOMMANDINFO lpici) PURE;
  480.  
  481.     STDMETHOD(GetCommandString)(THIS_
  482.                                 UINT        idCmd,
  483.                                 UINT        uType,
  484.                                 UINT      * pwReserved,
  485.                                 LPSTR       pszName,
  486.                                 UINT        cchMax) PURE;
  487.  
  488.     // *** IContextMenu2 methods ***
  489.     
  490.     STDMETHOD(HandleMenuMsg)(THIS_
  491.                              UINT uMsg,
  492.                              WPARAM wParam,
  493.                              LPARAM lParam) PURE;
  494.  
  495.     // *** IContextMenu3 methods ***
  496.     
  497.     STDMETHOD(HandleMenuMsg2)(THIS_
  498.                              UINT uMsg,
  499.                              WPARAM wParam,
  500.                              LPARAM lParam,
  501.                              LRESULT* plResult) PURE;
  502. };
  503.  
  504. typedef IContextMenu3 * LPCONTEXTMENU3;
  505.  
  506.  
  507. //===========================================================================
  508. //
  509. // Interface: IShellExtInit
  510. //
  511. //  The IShellExtInit interface is used by the explorer to initialize shell
  512. // extension objects. The explorer (1) calls CoCreateInstance (or equivalent)
  513. // with the registered CLSID and IID_IShellExtInit, (2) calls its Initialize
  514. // member, then (3) calls its QueryInterface to a particular interface (such
  515. // as IContextMenu or IPropSheetExt and (4) performs the rest of operation.
  516. //
  517. //
  518. // [Member functions]
  519. //
  520. // IShellExtInit::Initialize
  521. //
  522. //  This member function is called when the explorer is initializing either
  523. // context menu extension, property sheet extension or non-default drag-drop
  524. // extension.
  525. //
  526. //  Parameters: (context menu or property sheet extension)
  527. //   pidlFolder -- Specifies the parent folder
  528. //   lpdobj -- Spefifies the set of items selected in that folder.
  529. //   hkeyProgID -- Specifies the type of the focused item in the selection.
  530. //
  531. //  Parameters: (non-default drag-and-drop extension)
  532. //   pidlFolder -- Specifies the target (destination) folder
  533. //   lpdobj -- Specifies the items that are dropped (see the description
  534. //    about shell's clipboard below for clipboard formats).
  535. //   hkeyProgID -- Specifies the folder type.
  536. //
  537. //===========================================================================
  538.  
  539. #undef  INTERFACE
  540. #define INTERFACE   IShellExtInit
  541.  
  542. DECLARE_INTERFACE_(IShellExtInit, IUnknown)
  543. {
  544.     // *** IUnknown methods ***
  545.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  546.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  547.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  548.  
  549.     // *** IShellExtInit methods ***
  550.     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder,
  551.                           LPDATAOBJECT lpdobj, HKEY hkeyProgID) PURE;
  552. };
  553.  
  554. typedef IShellExtInit * LPSHELLEXTINIT;
  555.  
  556.  
  557. //===========================================================================
  558. //
  559. // Interface: IShellPropSheetExt
  560. //
  561. //  The explorer uses the IShellPropSheetExt to allow property sheet
  562. // extensions or control panel extensions to add additional property
  563. // sheet pages.
  564. //
  565. //
  566. // [Member functions]
  567. //
  568. // IShellPropSheetExt::AddPages
  569. //
  570. //  The explorer calls this member function when it finds a registered
  571. // property sheet extension for a particular type of object. For each
  572. // additional page, the extension creates a page object by calling
  573. // CreatePropertySheetPage API and calls lpfnAddPage.
  574. //
  575. //  Parameters:
  576. //   lpfnAddPage -- Specifies the callback function.
  577. //   lParam -- Specifies the opaque handle to be passed to the callback function.
  578. //
  579. //
  580. // IShellPropSheetExt::ReplacePage
  581. //
  582. //  The explorer never calls this member of property sheet extensions. The
  583. // explorer calls this member of control panel extensions, so that they
  584. // can replace some of default control panel pages (such as a page of
  585. // mouse control panel).
  586. //
  587. //  Parameters:
  588. //   uPageID -- Specifies the page to be replaced.
  589. //   lpfnReplace Specifies the callback function.
  590. //   lParam -- Specifies the opaque handle to be passed to the callback function.
  591. //
  592. //===========================================================================
  593.  
  594. #undef  INTERFACE
  595. #define INTERFACE   IShellPropSheetExt
  596.  
  597. DECLARE_INTERFACE_(IShellPropSheetExt, IUnknown)
  598. {
  599.     // *** IUnknown methods ***
  600.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  601.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  602.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  603.  
  604.     // *** IShellPropSheetExt methods ***
  605.     STDMETHOD(AddPages)(THIS_ LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) PURE;
  606.     STDMETHOD(ReplacePage)(THIS_ UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam) PURE;
  607. };
  608.  
  609. typedef IShellPropSheetExt * LPSHELLPROPSHEETEXT;
  610.  
  611.  
  612. //===========================================================================
  613. //
  614. // IPersistFolder Interface
  615. //
  616. //  The IPersistFolder interface is used by the file system implementation of
  617. // IShellFolder::BindToObject when it is initializing a shell folder object.
  618. //
  619. //
  620. // [Member functions]
  621. //
  622. // IPersistFolder::Initialize
  623. //
  624. //  This member function is called when the explorer is initializing a
  625. // shell folder object.
  626. //
  627. //  Parameters:
  628. //   pidl -- Specifies the absolute location of the folder.
  629. //
  630. //===========================================================================
  631.  
  632. #undef  INTERFACE
  633. #define INTERFACE   IPersistFolder
  634.  
  635. DECLARE_INTERFACE_(IPersistFolder, IPersist)    // fld
  636. {
  637.     // *** IUnknown methods ***
  638.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  639.     STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
  640.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  641.  
  642.     // *** IPersist methods ***
  643.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  644.  
  645.     // *** IPersistFolder methods ***
  646.     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  647. };
  648.  
  649. typedef IPersistFolder *LPPERSISTFOLDER;
  650.  
  651. #undef  INTERFACE
  652. #define INTERFACE   IPersistFolder2
  653.  
  654. DECLARE_INTERFACE_(IPersistFolder2, IPersistFolder)
  655. {
  656.     // *** IUnknown methods ***
  657.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  658.     STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
  659.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  660.  
  661.     // *** IPersist methods ***
  662.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  663.  
  664.     // *** IPersistFolder methods ***
  665.     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  666.  
  667.     // *** IPersistFolder2 methods ***
  668.     STDMETHOD(GetCurFolder)(THIS_ LPITEMIDLIST *ppidl) PURE;
  669. };
  670.  
  671.  
  672.  
  673. //===========================================================================
  674. //
  675. // IExtractIcon interface
  676. //
  677. //  This interface is used in two different places in the shell.
  678. //
  679. // Case-1: Icons of sub-folders for the scope-pane of the explorer.
  680. //
  681. //  It is used by the explorer to get the "icon location" of
  682. // sub-folders from each shell folders. When the user expands a folder
  683. // in the scope pane of the explorer, the explorer does following:
  684. //  (1) binds to the folder (gets IShellFolder),
  685. //  (2) enumerates its sub-folders by calling its EnumObjects member,
  686. //  (3) calls its GetUIObjectOf member to get IExtractIcon interface
  687. //     for each sub-folders.
  688. //  In this case, the explorer uses only IExtractIcon::GetIconLocation
  689. // member to get the location of the appropriate icon. An icon location
  690. // always consists of a file name (typically DLL or EXE) and either an icon
  691. // resource or an icon index.
  692. //
  693. //
  694. // Case-2: Extracting an icon image from a file
  695. //
  696. //  It is used by the shell when it extracts an icon image
  697. // from a file. When the shell is extracting an icon from a file,
  698. // it does following:
  699. //  (1) creates the icon extraction handler object (by getting its CLSID
  700. //     under the {ProgID}\shell\ExtractIconHanler key and calling
  701. //     CoCreateInstance requesting for IExtractIcon interface).
  702. //  (2) Calls IExtractIcon::GetIconLocation.
  703. //  (3) Then, calls IExtractIcon::ExtractIcon with the location/index pair.
  704. //  (4) If (3) returns NOERROR, it uses the returned icon.
  705. //  (5) Otherwise, it recursively calls this logic with new location
  706. //     assuming that the location string contains a fully qualified path name.
  707. //
  708. //  From extension programmer's point of view, there are only two cases
  709. // where they provide implementations of IExtractIcon:
  710. //  Case-1) providing explorer extensions (i.e., IShellFolder).
  711. //  Case-2) providing per-instance icons for some types of files.
  712. //
  713. // Because Case-1 is described above, we'll explain only Case-2 here.
  714. //
  715. // When the shell is about display an icon for a file, it does following:
  716. //  (1) Finds its ProgID and ClassID.
  717. //  (2) If the file has a ClassID, it gets the icon location string from the
  718. //    "DefaultIcon" key under it. The string indicates either per-class
  719. //    icon (e.g., "FOOBAR.DLL,2") or per-instance icon (e.g., "%1,1").
  720. //  (3) If a per-instance icon is specified, the shell creates an icon
  721. //    extraction handler object for it, and extracts the icon from it
  722. //    (which is described above).
  723. //
  724. //  It is important to note that the shell calls IExtractIcon::GetIconLocation
  725. // first, then calls IExtractIcon::Extract. Most application programs
  726. // that support per-instance icons will probably store an icon location
  727. // (DLL/EXE name and index/id) rather than an icon image in each file.
  728. // In those cases, a programmer needs to implement only the GetIconLocation
  729. // member and it Extract member simply returns S_FALSE. They need to
  730. // implement Extract member only if they decided to store the icon images
  731. // within files themselved or some other database (which is very rare).
  732. //
  733. //
  734. //
  735. // [Member functions]
  736. //
  737. //
  738. // IExtractIcon::GetIconLocation
  739. //
  740. //  This function returns an icon location.
  741. //
  742. //  Parameters:
  743. //   uFlags     [in]  -- Specifies if it is opened or not (GIL_OPENICON or 0)
  744. //   szIconFile [out] -- Specifies the string buffer buffer for a location name.
  745. //   cchMax     [in]  -- Specifies the size of szIconFile (almost always MAX_PATH)
  746. //   piIndex    [out] -- Sepcifies the address of UINT for the index.
  747. //   pwFlags    [out] -- Returns GIL_* flags
  748. //  Returns:
  749. //   NOERROR, if it returns a valid location; S_FALSE, if the shell use a
  750. //   default icon.
  751. //
  752. //  Notes: The location may or may not be a path to a file. The caller can
  753. //   not assume anything unless the subsequent Extract member call returns
  754. //   S_FALSE.
  755. //
  756. //   if the returned location is not a path to a file, GIL_NOTFILENAME should
  757. //   be set in the returned flags.
  758. //
  759. // IExtractIcon::Extract
  760. //
  761. //  This function extracts an icon image from a specified file.
  762. //
  763. //  Parameters:
  764. //   pszFile [in] -- Specifies the icon location (typically a path to a file).
  765. //   nIconIndex [in] -- Specifies the icon index.
  766. //   phiconLarge [out] -- Specifies the HICON variable for large icon.
  767. //   phiconSmall [out] -- Specifies the HICON variable for small icon.
  768. //   nIconSize [in] -- Specifies the size icon required (size of large icon)
  769. //                     LOWORD is the requested large icon size
  770. //                     HIWORD is the requested small icon size
  771. //  Returns:
  772. //   NOERROR, if it extracted the from the file.
  773. //   S_FALSE, if the caller should extract from the file specified in the
  774. //           location.
  775. //
  776. //===========================================================================
  777.  
  778. // GetIconLocation() input flags
  779.  
  780. #define GIL_OPENICON     0x0001      // allows containers to specify an "open" look
  781. #define GIL_FORSHELL     0x0002      // icon is to be displayed in a ShellFolder
  782. #define GIL_ASYNC        0x0020      // this is an async extract, return E_ASYNC
  783.  
  784. // GetIconLocation() return flags
  785.  
  786. #define GIL_SIMULATEDOC  0x0001      // simulate this document icon for this
  787. #define GIL_PERINSTANCE  0x0002      // icons from this class are per instance (each file has its own)
  788. #define GIL_PERCLASS     0x0004      // icons from this class per class (shared for all files of this type)
  789. #define GIL_NOTFILENAME  0x0008      // location is not a filename, must call ::ExtractIcon
  790. #define GIL_DONTCACHE    0x0010      // this icon should not be cached
  791.  
  792. #undef  INTERFACE
  793. #define INTERFACE   IExtractIconA
  794.  
  795. DECLARE_INTERFACE_(IExtractIconA, IUnknown)     // exic
  796. {
  797.     // *** IUnknown methods ***
  798.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  799.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  800.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  801.  
  802.     // *** IExtractIcon methods ***
  803.     STDMETHOD(GetIconLocation)(THIS_
  804.                          UINT   uFlags,
  805.                          LPSTR  szIconFile,
  806.                          UINT   cchMax,
  807.                          int   * piIndex,
  808.                          UINT  * pwFlags) PURE;
  809.  
  810.     STDMETHOD(Extract)(THIS_
  811.                            LPCSTR pszFile,
  812.                            UINT   nIconIndex,
  813.                            HICON   *phiconLarge,
  814.                            HICON   *phiconSmall,
  815.                            UINT    nIconSize) PURE;
  816. };
  817.  
  818. typedef IExtractIconA * LPEXTRACTICONA;
  819.  
  820. #undef  INTERFACE
  821. #define INTERFACE   IExtractIconW
  822.  
  823. DECLARE_INTERFACE_(IExtractIconW, IUnknown)     // exic
  824. {
  825.     // *** IUnknown methods ***
  826.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  827.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  828.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  829.  
  830.     // *** IExtractIcon methods ***
  831.     STDMETHOD(GetIconLocation)(THIS_
  832.                          UINT   uFlags,
  833.                          LPWSTR szIconFile,
  834.                          UINT   cchMax,
  835.                          int   * piIndex,
  836.                          UINT  * pwFlags) PURE;
  837.  
  838.     STDMETHOD(Extract)(THIS_
  839.                            LPCWSTR pszFile,
  840.                            UINT   nIconIndex,
  841.                            HICON   *phiconLarge,
  842.                            HICON   *phiconSmall,
  843.                            UINT    nIconSize) PURE;
  844. };
  845.  
  846. typedef IExtractIconW * LPEXTRACTICONW;
  847.  
  848. #ifdef UNICODE
  849. #define IExtractIcon        IExtractIconW
  850. #define IExtractIconVtbl    IExtractIconWVtbl
  851. #define LPEXTRACTICON       LPEXTRACTICONW
  852. #else
  853. #define IExtractIcon        IExtractIconA
  854. #define IExtractIconVtbl    IExtractIconAVtbl
  855. #define LPEXTRACTICON       LPEXTRACTICONA
  856. #endif
  857.  
  858. //===========================================================================
  859. //
  860. // IShellIcon Interface
  861. //
  862. // used to get a icon index for a IShellFolder object.
  863. //
  864. // this interface can be implemented by a IShellFolder, as a quick way to
  865. // return the icon for a object in the folder.
  866. //
  867. // a instance of this interface is only created once for the folder, unlike
  868. // IExtractIcon witch is created once for each object.
  869. //
  870. // if a ShellFolder does not implement this interface, the standard
  871. // GetUIObject(....IExtractIcon) method will be used to get a icon
  872. // for all objects.
  873. //
  874. // the following standard imagelist indexs can be returned:
  875. //
  876. //      0   document (blank page) (not associated)
  877. //      1   document (with stuff on the page)
  878. //      2   application (exe, com, bat)
  879. //      3   folder (plain)
  880. //      4   folder (open)
  881. //
  882. // IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
  883. //
  884. //      pidl            object to get icon for.
  885. //      flags           GIL_* input flags (GIL_OPEN, ...)
  886. //      lpIconIndex     place to return icon index.
  887. //
  888. //  returns:
  889. //      NOERROR, if lpIconIndex contains the correct system imagelist index.
  890. //      S_FALSE, if unable to get icon for this object, go through
  891. //               GetUIObject, IExtractIcon, methods.
  892. //
  893. //===========================================================================
  894.  
  895. #undef  INTERFACE
  896. #define INTERFACE   IShellIcon
  897.  
  898. DECLARE_INTERFACE_(IShellIcon, IUnknown)      // shi
  899. {
  900.     // *** IUnknown methods ***
  901.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  902.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  903.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  904.  
  905.     // *** IShellIcon methods ***
  906.     STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags,
  907.                     LPINT lpIconIndex) PURE;
  908. };
  909.  
  910. typedef IShellIcon *LPSHELLICON;
  911.  
  912. //===========================================================================
  913. //
  914. // IShellIconOverlayIdentifier
  915. //
  916. // Used to identify a file as a member of the group of files that have this specific 
  917. // icon overlay
  918. //
  919. // Users can create new IconOverlayIdentifiers and place them in the following registry
  920. // location together with the Icon overlay image and their priority. 
  921. // HKEY_LOCAL_MACHINE "Software\\Microsoft\\Windows\\CurrentVersion\\ShellIconOverlayIdentifiers"
  922. // 
  923. // The shell will enumerate through all IconOverlayIdentifiers at start, and prioritize 
  924. // them according to internal rules, in case the internal rules don't apply, we use their 
  925. // input priority
  926. //
  927. // IShellIconOverlayIdentifier:IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
  928. //      pwszPath        full path of the file
  929. //      dwAttrib        attribute of this file 
  930. //
  931. //  returns:
  932. //      S_OK,    if the file is a member
  933. //      S_FALSE, if the file is not a member
  934. //      E_FAIL,  if the operation failed due to bad WIN32_FIND_DATA
  935. //
  936. // IShellIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int * pIndex, DWORD * dwFlags) PURE;
  937. //      pszIconFile    the path of the icon file
  938. //      pIndex         Depend on the flags, this could contain the IconIndex or the Sytem Imagelist Index
  939. //      dwFlags        defined below
  940. //
  941. // IShellIconOverlayIdentifier::GetPriority(int * pIPriority) PURE;
  942. //      pIPriority     the priority of this Overlay Identifier
  943. //
  944. //===========================================================================
  945.  
  946. #undef  INTERFACE
  947. #define INTERFACE   IShellIconOverlayIdentifier
  948.  
  949. DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
  950. {
  951.     // *** IUnknown methods ***
  952.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  953.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  954.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  955.  
  956.     // *** IShellIconOverlayIdentifier methods ***
  957.     STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;  
  958.     STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;  
  959.     STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
  960. };
  961.  
  962. #define ISIOI_ICONFILE            0x00000001          // path is returned through pwszIconFile
  963. #define ISIOI_ICONINDEX           0x00000002          // icon index in pwszIconFile is returned through pIndex 
  964. #define ISIOI_SYSIMAGELISTINDEX   0x00000004          // system imagelist icon index is returned through pIndex
  965.  
  966.  
  967. //===========================================================================
  968. //
  969. // IShellIconOverlay
  970. //
  971. // Used to return the icon overlay index or its icon index for an IShellFolder object, 
  972. // this is always implemented with IShellFolder 
  973. //
  974. // IShellIconOverlay:GetOverlayIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  975. //      pidl            object to identify icon overlay for.
  976. //      pdwIndex        the Overlay Index in the system image list
  977. //
  978. // IShellIconOverlay:GetOverlayIconIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  979. //      pdwIconIndex    the Overlay Icon index in the system image list 
  980. // This method is only used for those who are interested in seeing the real bits 
  981. // of the Overlay Icon
  982. //
  983. //  returns:
  984. //      S_OK,  if the index of an Overlay is found
  985. //      S_FALSE, if no Overlay exists for this file
  986. //      E_FAIL, if pidl is bad 
  987. //
  988. //===========================================================================
  989.  
  990. #undef  INTERFACE
  991. #define INTERFACE   IShellIconOverlay
  992.  
  993. DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
  994. {
  995.     // *** IUnknown methods ***
  996.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  997.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  998.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  999.  
  1000.     // *** IShellIconOverlay methods ***
  1001.     STDMETHOD(GetOverlayIndex)(THIS_ LPCITEMIDLIST pidl, int * pIndex) PURE;
  1002.     STDMETHOD(GetOverlayIconIndex)(THIS_ LPCITEMIDLIST pidl, int * pIconIndex) PURE;
  1003. };
  1004.  
  1005. //===========================================================================
  1006. //
  1007. // IShellLink Interface
  1008. //
  1009. //===========================================================================
  1010.  
  1011. #ifdef UNICODE
  1012. #define IShellLink      IShellLinkW
  1013. #define IShellLinkVtbl  IShellLinkWVtbl
  1014. #else
  1015. #define IShellLink      IShellLinkA
  1016. #define IShellLinkVtbl  IShellLinkAVtbl
  1017. #endif
  1018.  
  1019. // IShellLink::Resolve fFlags
  1020. typedef enum {
  1021.     SLR_NO_UI           = 0x0001,
  1022.     SLR_ANY_MATCH       = 0x0002,
  1023.     SLR_UPDATE          = 0x0004,
  1024.     SLR_NOUPDATE        = 0x0008,
  1025. } SLR_FLAGS;
  1026.  
  1027. // IShellLink::GetPath fFlags
  1028. typedef enum {
  1029.     SLGP_SHORTPATH      = 0x0001,
  1030.     SLGP_UNCPRIORITY    = 0x0002,
  1031.     SLGP_RAWPATH        = 0x0004,
  1032. } SLGP_FLAGS;
  1033.  
  1034. #undef  INTERFACE
  1035. #define INTERFACE   IShellLinkA
  1036.  
  1037. DECLARE_INTERFACE_(IShellLinkA, IUnknown)       // sl
  1038. {
  1039.     // *** IUnknown methods ***
  1040.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1041.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1042.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1043.  
  1044.     // *** IShellLink methods ***
  1045.     STDMETHOD(GetPath)(THIS_ LPSTR pszFile, int cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) PURE;
  1046.  
  1047.     STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
  1048.     STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
  1049.  
  1050.     STDMETHOD(GetDescription)(THIS_ LPSTR pszName, int cchMaxName) PURE;
  1051.     STDMETHOD(SetDescription)(THIS_ LPCSTR pszName) PURE;
  1052.  
  1053.     STDMETHOD(GetWorkingDirectory)(THIS_ LPSTR pszDir, int cchMaxPath) PURE;
  1054.     STDMETHOD(SetWorkingDirectory)(THIS_ LPCSTR pszDir) PURE;
  1055.  
  1056.     STDMETHOD(GetArguments)(THIS_ LPSTR pszArgs, int cchMaxPath) PURE;
  1057.     STDMETHOD(SetArguments)(THIS_ LPCSTR pszArgs) PURE;
  1058.  
  1059.     STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
  1060.     STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
  1061.  
  1062.     STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
  1063.     STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
  1064.  
  1065.     STDMETHOD(GetIconLocation)(THIS_ LPSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
  1066.     STDMETHOD(SetIconLocation)(THIS_ LPCSTR pszIconPath, int iIcon) PURE;
  1067.  
  1068.     STDMETHOD(SetRelativePath)(THIS_ LPCSTR pszPathRel, DWORD dwReserved) PURE;
  1069.  
  1070.     STDMETHOD(Resolve)(THIS_ HWND hwnd, DWORD fFlags) PURE;
  1071.  
  1072.     STDMETHOD(SetPath)(THIS_ LPCSTR pszFile) PURE;
  1073. };
  1074.  
  1075. #undef  INTERFACE
  1076. #define INTERFACE   IShellLinkW
  1077.  
  1078. DECLARE_INTERFACE_(IShellLinkW, IUnknown)       // sl
  1079. {
  1080.     // *** IUnknown methods ***
  1081.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1082.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1083.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1084.  
  1085.     // *** IShellLink methods ***
  1086.     STDMETHOD(GetPath)(THIS_ LPWSTR pszFile, int cchMaxPath, WIN32_FIND_DATAW *pfd, DWORD fFlags) PURE;
  1087.  
  1088.     STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
  1089.     STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
  1090.  
  1091.     STDMETHOD(GetDescription)(THIS_ LPWSTR pszName, int cchMaxName) PURE;
  1092.     STDMETHOD(SetDescription)(THIS_ LPCWSTR pszName) PURE;
  1093.  
  1094.     STDMETHOD(GetWorkingDirectory)(THIS_ LPWSTR pszDir, int cchMaxPath) PURE;
  1095.     STDMETHOD(SetWorkingDirectory)(THIS_ LPCWSTR pszDir) PURE;
  1096.  
  1097.     STDMETHOD(GetArguments)(THIS_ LPWSTR pszArgs, int cchMaxPath) PURE;
  1098.     STDMETHOD(SetArguments)(THIS_ LPCWSTR pszArgs) PURE;
  1099.  
  1100.     STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
  1101.     STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
  1102.  
  1103.     STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
  1104.     STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
  1105.  
  1106.     STDMETHOD(GetIconLocation)(THIS_ LPWSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
  1107.     STDMETHOD(SetIconLocation)(THIS_ LPCWSTR pszIconPath, int iIcon) PURE;
  1108.  
  1109.     STDMETHOD(SetRelativePath)(THIS_ LPCWSTR pszPathRel, DWORD dwReserved) PURE;
  1110.  
  1111.     STDMETHOD(Resolve)(THIS_ HWND hwnd, DWORD fFlags) PURE;
  1112.  
  1113.     STDMETHOD(SetPath)(THIS_ LPCWSTR pszFile) PURE;
  1114. };
  1115.  
  1116.  
  1117. #ifdef _INC_SHELLAPI    /* for LPSHELLEXECUTEINFO */
  1118. //===========================================================================
  1119. //
  1120. // IShellExecuteHook Interface
  1121. //
  1122. //===========================================================================
  1123.  
  1124. #undef  INTERFACE
  1125. #define INTERFACE   IShellExecuteHookA
  1126.  
  1127. DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) // shexhk
  1128. {
  1129.     // *** IUnknown methods ***
  1130.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1131.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1132.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1133.  
  1134.     // *** IShellExecuteHookA methods ***
  1135.     STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOA pei) PURE;
  1136. };
  1137.  
  1138. #undef  INTERFACE
  1139. #define INTERFACE   IShellExecuteHookW
  1140.  
  1141. DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) // shexhk
  1142. {
  1143.     // *** IUnknown methods ***
  1144.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1145.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1146.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1147.  
  1148.     // *** IShellExecuteHookW methods ***
  1149.     STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOW pei) PURE;
  1150. };
  1151.  
  1152. #ifdef UNICODE
  1153. #define IShellExecuteHook       IShellExecuteHookW
  1154. #define IShellExecuteHookVtbl   IShellExecuteHookWVtbl
  1155. #else
  1156. #define IShellExecuteHook       IShellExecuteHookA
  1157. #define IShellExecuteHookVtbl   IShellExecuteHookAVtbl
  1158. #endif
  1159. #endif
  1160.  
  1161. //===========================================================================
  1162. //
  1163. // IURLSearchHook Interface
  1164. //
  1165. //===========================================================================
  1166.  
  1167. #undef  INTERFACE
  1168. #define INTERFACE   IURLSearchHook
  1169.  
  1170. DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
  1171. {
  1172.     // *** IUnknown methods ***
  1173.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1174.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1175.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1176.  
  1177.     // *** IURLSearchHook methods ***
  1178.     STDMETHOD(Translate)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize) PURE;
  1179. };
  1180.  
  1181. //===========================================================================
  1182. //
  1183. // INewShortcutHook Interface
  1184. //
  1185. //===========================================================================
  1186.  
  1187. #undef  INTERFACE
  1188. #define INTERFACE   INewShortcutHookA
  1189.  
  1190. DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) // nshhk
  1191. {
  1192.     // *** IUnknown methods ***
  1193.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1194.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1195.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1196.  
  1197.     // *** INewShortcutHook methods ***
  1198.     STDMETHOD(SetReferent)(THIS_ LPCSTR pcszReferent, HWND hwnd) PURE;
  1199.     STDMETHOD(GetReferent)(THIS_ LPSTR pszReferent, int cchReferent) PURE;
  1200.     STDMETHOD(SetFolder)(THIS_ LPCSTR pcszFolder) PURE;
  1201.     STDMETHOD(GetFolder)(THIS_ LPSTR pszFolder, int cchFolder) PURE;
  1202.     STDMETHOD(GetName)(THIS_ LPSTR pszName, int cchName) PURE;
  1203.     STDMETHOD(GetExtension)(THIS_ LPSTR pszExtension, int cchExtension) PURE;
  1204. };
  1205.  
  1206. #undef  INTERFACE
  1207. #define INTERFACE   INewShortcutHookW
  1208.  
  1209. DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) // nshhk
  1210. {
  1211.     // *** IUnknown methods ***
  1212.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1213.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1214.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1215.  
  1216.     // *** INewShortcutHook methods ***
  1217.     STDMETHOD(SetReferent)(THIS_ LPCWSTR pcszReferent, HWND hwnd) PURE;
  1218.     STDMETHOD(GetReferent)(THIS_ LPWSTR pszReferent, int cchReferent) PURE;
  1219.     STDMETHOD(SetFolder)(THIS_ LPCWSTR pcszFolder) PURE;
  1220.     STDMETHOD(GetFolder)(THIS_ LPWSTR pszFolder, int cchFolder) PURE;
  1221.     STDMETHOD(GetName)(THIS_ LPWSTR pszName, int cchName) PURE;
  1222.     STDMETHOD(GetExtension)(THIS_ LPWSTR pszExtension, int cchExtension) PURE;
  1223. };
  1224.  
  1225. #ifdef UNICODE
  1226. #define INewShortcutHook        INewShortcutHookW
  1227. #define INewShortcutHookVtbl    INewShortcutHookWVtbl
  1228. #else
  1229. #define INewShortcutHook        INewShortcutHookA
  1230. #define INewShortcutHookVtbl    INewShortcutHookAVtbl
  1231. #endif
  1232.  
  1233. //===========================================================================
  1234. //
  1235. // ICopyHook Interface
  1236. //
  1237. //  The copy hook is called whenever file system directories are
  1238. //  copy/moved/deleted/renamed via the shell.  It is also called by the shell
  1239. //  on changes of status of printers.
  1240. //
  1241. //  Clients register their id under STRREG_SHEX_COPYHOOK for file system hooks
  1242. //  and STRREG_SHEx_PRNCOPYHOOK for printer hooks.
  1243. //  the CopyCallback is called prior to the action, so the hook has the chance
  1244. //  to allow, deny or cancel the operation by returning the falues:
  1245. //     IDYES  -  means allow the operation
  1246. //     IDNO   -  means disallow the operation on this file, but continue with
  1247. //              any other operations (eg. batch copy)
  1248. //     IDCANCEL - means disallow the current operation and cancel any pending
  1249. //              operations
  1250. //
  1251. //   arguments to the CopyCallback
  1252. //      hwnd - window to use for any UI
  1253. //      wFunc - what operation is being done
  1254. //      wFlags - and flags (FOF_*) set in the initial call to the file operation
  1255. //      pszSrcFile - name of the source file
  1256. //      dwSrcAttribs - file attributes of the source file
  1257. //      pszDestFile - name of the destiation file (for move and renames)
  1258. //      dwDestAttribs - file attributes of the destination file
  1259. //
  1260. //
  1261. //===========================================================================
  1262.  
  1263. #ifndef FO_MOVE //these need to be kept in sync with the ones in shellapi.h
  1264.  
  1265. // file operations
  1266.  
  1267. #define FO_MOVE           0x0001
  1268. #define FO_COPY           0x0002
  1269. #define FO_DELETE         0x0003
  1270. #define FO_RENAME         0x0004
  1271.  
  1272. #define FOF_MULTIDESTFILES         0x0001
  1273. #define FOF_CONFIRMMOUSE           0x0002
  1274. #define FOF_SILENT                 0x0004  // don't create progress/report
  1275. #define FOF_RENAMEONCOLLISION      0x0008
  1276. #define FOF_NOCONFIRMATION         0x0010  // Don't prompt the user.
  1277. #define FOF_WANTMAPPINGHANDLE      0x0020  // Fill in SHFILEOPSTRUCT.hNameMappings
  1278.                                       // Must be freed using SHFreeNameMappings
  1279. #define FOF_ALLOWUNDO              0x0040
  1280. #define FOF_FILESONLY              0x0080  // on *.*, do only files
  1281. #define FOF_SIMPLEPROGRESS         0x0100  // means don't show names of files
  1282. #define FOF_NOCONFIRMMKDIR         0x0200  // don't confirm making any needed dirs
  1283. #define FOF_NOERRORUI              0x0400  // don't put up error UI
  1284. #define FOF_NOCOPYSECURITYATTRIBS  0x0800  // dont copy NT file Security Attributes
  1285.  
  1286. typedef UINT FILEOP_FLAGS;
  1287.  
  1288. // printer operations
  1289.  
  1290. #define PO_DELETE       0x0013  // printer is being deleted
  1291. #define PO_RENAME       0x0014  // printer is being renamed
  1292. #define PO_PORTCHANGE   0x0020  // port this printer connected to is being changed
  1293.                                 // if this id is set, the strings received by
  1294.                                 // the copyhook are a doubly-null terminated
  1295.                                 // list of strings.  The first is the printer
  1296.                                 // name and the second is the printer port.
  1297. #define PO_REN_PORT     0x0034  // PO_RENAME and PO_PORTCHANGE at same time.
  1298.  
  1299. // no POF_ flags currently defined
  1300.  
  1301. typedef UINT PRINTEROP_FLAGS;
  1302.  
  1303. #endif // FO_MOVE
  1304.  
  1305. #undef  INTERFACE
  1306. #define INTERFACE   ICopyHookA
  1307.  
  1308. DECLARE_INTERFACE_(ICopyHookA, IUnknown)        // sl
  1309. {
  1310.     // *** IUnknown methods ***
  1311.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1312.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1313.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1314.  
  1315.     // *** ICopyHook methods ***
  1316.     STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs,
  1317.                                    LPCSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1318. };
  1319.  
  1320. typedef ICopyHookA *    LPCOPYHOOKA;
  1321.  
  1322. #undef  INTERFACE
  1323. #define INTERFACE   ICopyHookW
  1324.  
  1325. DECLARE_INTERFACE_(ICopyHookW, IUnknown)        // sl
  1326. {
  1327.     // *** IUnknown methods ***
  1328.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1329.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1330.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1331.  
  1332.     // *** ICopyHook methods ***
  1333.     STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCWSTR pszSrcFile, DWORD dwSrcAttribs,
  1334.                                    LPCWSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1335. };
  1336.  
  1337. typedef ICopyHookW *    LPCOPYHOOKW;
  1338.  
  1339. #ifdef UNICODE
  1340. #define ICopyHook       ICopyHookW
  1341. #define ICopyHookVtbl   ICopyHookWVtbl
  1342. #define LPCOPYHOOK      LPCOPYHOOKW
  1343. #else
  1344. #define ICopyHook       ICopyHookA
  1345. #define ICopyHookVtbl   ICopyHookAVtbl
  1346. #define LPCOPYHOOK      LPCOPYHOOKA
  1347. #endif
  1348.  
  1349. //===========================================================================
  1350. //
  1351. // IFileViewerSite Interface
  1352. //
  1353. //===========================================================================
  1354.  
  1355. #undef  INTERFACE
  1356. #define INTERFACE   IFileViewerSite
  1357.  
  1358. DECLARE_INTERFACE_(IFileViewerSite, IUnknown)
  1359. {
  1360.     // *** IUnknown methods ***
  1361.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1362.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1363.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1364.  
  1365.     // *** IFileViewerSite methods ***
  1366.     STDMETHOD(SetPinnedWindow) (THIS_ HWND hwnd) PURE;
  1367.     STDMETHOD(GetPinnedWindow) (THIS_ HWND *phwnd) PURE;
  1368. };
  1369.  
  1370. typedef IFileViewerSite * LPFILEVIEWERSITE;
  1371.  
  1372.  
  1373. //===========================================================================
  1374. //
  1375. // IFileViewer Interface
  1376. //
  1377. // Implemented in a FileViewer component object.  Used to tell a
  1378. // FileViewer to PrintTo or to view, the latter happening though
  1379. // ShowInitialize and Show.  The filename is always given to the
  1380. // viewer through IPersistFile.
  1381. //
  1382. //===========================================================================
  1383.  
  1384. typedef struct
  1385. {
  1386.     // Stuff passed into viewer (in)
  1387.     DWORD cbSize;           // Size of structure for future expansion...
  1388.     HWND hwndOwner;         // who is the owner window.
  1389.     int iShow;              // The show command
  1390.  
  1391.     // Passed in and updated  (in/Out)
  1392.     DWORD dwFlags;          // flags
  1393.     RECT rect;              // Where to create the window may have defaults
  1394.     LPUNKNOWN punkRel;      // Relese this interface when window is visible
  1395.  
  1396.     // Stuff that might be returned from viewer (out)
  1397.     OLECHAR strNewFile[MAX_PATH];   // New File to view.
  1398.  
  1399. } FVSHOWINFO, *LPFVSHOWINFO;
  1400.  
  1401.     // Define File View Show Info Flags.
  1402. #define FVSIF_RECT      0x00000001      // The rect variable has valid data.
  1403. #define FVSIF_PINNED    0x00000002      // We should Initialize pinned
  1404.  
  1405. #define FVSIF_NEWFAILED 0x08000000      // The new file passed back failed
  1406.                                         // to be viewed.
  1407.  
  1408. #define FVSIF_NEWFILE   0x80000000      // A new file to view has been returned
  1409. #define FVSIF_CANVIEWIT 0x40000000      // The viewer can view it.
  1410.  
  1411. #undef  INTERFACE
  1412. #define INTERFACE   IFileViewerA
  1413.  
  1414. DECLARE_INTERFACE(IFileViewerA)
  1415. {
  1416.     // *** IUnknown methods ***
  1417.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1418.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1419.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1420.  
  1421.     // *** IFileViewer methods ***
  1422.     STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1423.     STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1424.     STDMETHOD(PrintTo) (THIS_ LPSTR pszDriver, BOOL fSuppressUI) PURE;
  1425. };
  1426.  
  1427. typedef IFileViewerA * LPFILEVIEWERA;
  1428.  
  1429. #undef  INTERFACE
  1430. #define INTERFACE   IFileViewerW
  1431.  
  1432. DECLARE_INTERFACE(IFileViewerW)
  1433. {
  1434.     // *** IUnknown methods ***
  1435.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1436.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1437.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1438.  
  1439.     // *** IFileViewer methods ***
  1440.     STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1441.     STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1442.     STDMETHOD(PrintTo) (THIS_ LPWSTR pszDriver, BOOL fSuppressUI) PURE;
  1443. };
  1444.  
  1445. typedef IFileViewerW * LPFILEVIEWERW;
  1446.  
  1447. #ifdef UNICODE
  1448. #define IFileViewer IFileViewerW
  1449. #define LPFILEVIEWER LPFILEVIEWERW
  1450. #else
  1451. #define IFileViewer IFileViewerA
  1452. #define LPFILEVIEWER LPFILEVIEWERA
  1453. #endif
  1454.  
  1455.  
  1456.  
  1457. //==========================================================================
  1458. //
  1459. // IShellBrowser/IShellView/IShellFolder interface
  1460. //
  1461. //  These three interfaces are used when the shell communicates with
  1462. // name space extensions. The shell (explorer) provides IShellBrowser
  1463. // interface, and extensions implements IShellFolder and IShellView
  1464. // interfaces.
  1465. //
  1466. //==========================================================================
  1467.  
  1468.  
  1469. //--------------------------------------------------------------------------
  1470. //
  1471. // Command/menuitem IDs
  1472. //
  1473. //  The explorer dispatches WM_COMMAND messages based on the range of
  1474. // command/menuitem IDs. All the IDs of menuitems that the view (right
  1475. // pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
  1476. // won't dispatch them). The view should not deal with any menuitems
  1477. // in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
  1478. // version of the shell).
  1479. //
  1480. //  FCIDM_SHVIEWFIRST/LAST      for the right pane (IShellView)
  1481. //  FCIDM_BROWSERFIRST/LAST     for the explorer frame (IShellBrowser)
  1482. //  FCIDM_GLOBAL/LAST           for the explorer's submenu IDs
  1483. //
  1484. //--------------------------------------------------------------------------
  1485.  
  1486. #define FCIDM_SHVIEWFIRST           0x0000
  1487. #define FCIDM_SHVIEWLAST            0x7fff
  1488. #define FCIDM_BROWSERFIRST          0xa000
  1489. #define FCIDM_BROWSERLAST           0xbf00
  1490. #define FCIDM_GLOBALFIRST           0x8000
  1491. #define FCIDM_GLOBALLAST            0x9fff
  1492.  
  1493. //
  1494. // Global submenu IDs and separator IDs
  1495. //
  1496. #define FCIDM_MENU_FILE             (FCIDM_GLOBALFIRST+0x0000)
  1497. #define FCIDM_MENU_EDIT             (FCIDM_GLOBALFIRST+0x0040)
  1498. #define FCIDM_MENU_VIEW             (FCIDM_GLOBALFIRST+0x0080)
  1499. #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
  1500. #define FCIDM_MENU_TOOLS            (FCIDM_GLOBALFIRST+0x00c0)
  1501. #define FCIDM_MENU_TOOLS_SEP_GOTO   (FCIDM_GLOBALFIRST+0x00c1)
  1502. #define FCIDM_MENU_HELP             (FCIDM_GLOBALFIRST+0x0100)
  1503. #define FCIDM_MENU_FIND             (FCIDM_GLOBALFIRST+0x0140)
  1504. #define FCIDM_MENU_EXPLORE          (FCIDM_GLOBALFIRST+0x0150)
  1505. #define FCIDM_MENU_FAVORITES        (FCIDM_GLOBALFIRST+0x0170)
  1506.  
  1507. //--------------------------------------------------------------------------
  1508. // control IDs known to the view
  1509. //--------------------------------------------------------------------------
  1510.  
  1511. #define FCIDM_TOOLBAR      (FCIDM_BROWSERFIRST + 0)
  1512. #define FCIDM_STATUS       (FCIDM_BROWSERFIRST + 1)
  1513.  
  1514. #if (_WIN32_IE >= 0x0400)
  1515. //--------------------------------------------------------------------------
  1516. //
  1517. // The resource id of the offline cursor
  1518. // This cursor is avaialble in shdocvw.dll 
  1519. #define IDC_OFFLINE_HAND        103
  1520. //
  1521. //--------------------------------------------------------------------------
  1522. #endif
  1523.  
  1524. //--------------------------------------------------------------------------
  1525. //
  1526. // FOLDERSETTINGS
  1527. //
  1528. //  FOLDERSETTINGS is a data structure that explorer passes from one folder
  1529. // view to another, when the user is browsing. It calls ISV::GetCurrentInfo
  1530. // member to get the current settings and pass it to ISV::CreateViewWindow
  1531. // to allow the next folder view "inherit" it. These settings assumes a
  1532. // particular UI (which the shell's folder view has), and shell extensions
  1533. // may or may not use those settings.
  1534. //
  1535. //--------------------------------------------------------------------------
  1536.  
  1537. typedef LPBYTE LPVIEWSETTINGS;
  1538.  
  1539. // NB Bitfields.
  1540. // FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL
  1541. typedef enum
  1542.     {
  1543.     FWF_AUTOARRANGE =       0x0001,
  1544.     FWF_ABBREVIATEDNAMES =  0x0002,
  1545.     FWF_SNAPTOGRID =        0x0004,
  1546.     FWF_OWNERDATA =         0x0008,
  1547.     FWF_BESTFITWINDOW =     0x0010,
  1548.     FWF_DESKTOP =           0x0020,
  1549.     FWF_SINGLESEL =         0x0040,
  1550.     FWF_NOSUBFOLDERS =      0x0080,
  1551.     FWF_TRANSPARENT  =      0x0100,
  1552.     FWF_NOCLIENTEDGE =      0x0200,
  1553.     FWF_NOSCROLL     =      0x0400,
  1554.     FWF_ALIGNLEFT    =      0x0800,
  1555.     FWF_NOICONS      =      0x1000,
  1556.     FWF_SINGLECLICKACTIVATE=0x8000  // TEMPORARY -- NO UI FOR THIS
  1557.     } FOLDERFLAGS;
  1558.  
  1559. typedef enum
  1560.     {
  1561.     FVM_ICON =              1,
  1562.     FVM_SMALLICON =         2,
  1563.     FVM_LIST =              3,
  1564.     FVM_DETAILS =           4,
  1565.     } FOLDERVIEWMODE;
  1566.  
  1567. typedef struct
  1568.     {
  1569.     UINT ViewMode;       // View mode (FOLDERVIEWMODE values)
  1570.     UINT fFlags;         // View options (FOLDERFLAGS bits)
  1571.     } FOLDERSETTINGS, *LPFOLDERSETTINGS;
  1572.  
  1573. typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
  1574.  
  1575. //--------------------------------------------------------------------------
  1576. //
  1577. // Interface:   IShellBrowser
  1578. //
  1579. //  IShellBrowser interface is the interface that is provided by the shell
  1580. // explorer/folder frame window. When it creates the "contents pane" of
  1581. // a shell folder (which provides IShellFolder interface), it calls its
  1582. // CreateViewObject member function to create an IShellView object. Then,
  1583. // it calls its CreateViewWindow member to create the "contents pane"
  1584. // window. The pointer to the IShellBrowser interface is passed to
  1585. // the IShellView object as a parameter to this CreateViewWindow member
  1586. // function call.
  1587. //
  1588. //    +--------------------------+  <-- Explorer window
  1589. //    | [] Explorer              |
  1590. //    |--------------------------+       IShellBrowser
  1591. //    | File Edit View ..        |
  1592. //    |--------------------------|
  1593. //    |        |                 |
  1594. //    |        |              <-------- Content pane
  1595. //    |        |                 |
  1596. //    |        |                 |       IShellView
  1597. //    |        |                 |
  1598. //    |        |                 |
  1599. //    +--------------------------+
  1600. //
  1601. //
  1602. //
  1603. // [Member functions]
  1604. //
  1605. //
  1606. // IShellBrowser::GetWindow(phwnd)
  1607. //
  1608. //   Inherited from IOleWindow::GetWindow.
  1609. //
  1610. //
  1611. // IShellBrowser::ContextSensitiveHelp(fEnterMode)
  1612. //
  1613. //   Inherited from IOleWindow::ContextSensitiveHelp.
  1614. //
  1615. //
  1616. // IShellBrowser::InsertMenusSB(hmenuShared, lpMenuWidths)
  1617. //
  1618. //   Similar to the IOleInPlaceFrame::InsertMenus. The explorer will put
  1619. //  "File" and "Edit" pulldown in the File menu group, "View" and "Tools"
  1620. //  in the Container menu group and "Help" in the Window menu group. Each
  1621. //  pulldown menu will have a uniqu ID, FCIDM_MENU_FILE/EDIT/VIEW/TOOLS/HELP.
  1622. //  The view is allowed to insert menuitems into those sub-menus by those
  1623. //  IDs must be between FCIDM_SHVIEWFIRST and FCIDM_SHVIEWLAST.
  1624. //
  1625. //
  1626. // IShellBrowser::SetMenuSB(hmenuShared, holemenu, hwndActiveObject)
  1627. //
  1628. //   Similar to the IOleInPlaceFrame::SetMenu. The explorer ignores the
  1629. //  holemenu parameter (reserved for future enhancement)  and performs
  1630. //  menu-dispatch based on the menuitem IDs (see the description above).
  1631. //  It is important to note that the explorer will add different
  1632. //  set of menuitems depending on whether the view has a focus or not.
  1633. //  Therefore, it is very important to call ISB::OnViewWindowActivate
  1634. //  whenever the view window (or its children) gets the focus.
  1635. //
  1636. //
  1637. // IShellBrowser::RemoveMenusSB(hmenuShared)
  1638. //
  1639. //   Same as the IOleInPlaceFrame::RemoveMenus.
  1640. //
  1641. //
  1642. // IShellBrowser::SetStatusTextSB(lpszStatusText)
  1643. //
  1644. //   Same as the IOleInPlaceFrame::SetStatusText. It is also possible to
  1645. //  send messages directly to the status window via SendControlMsg.
  1646. //
  1647. //
  1648. // IShellBrowser::EnableModelessSB(fEnable)
  1649. //
  1650. //   Same as the IOleInPlaceFrame::EnableModeless.
  1651. //
  1652. //
  1653. // IShellBrowser::TranslateAcceleratorSB(lpmsg, wID)
  1654. //
  1655. //   Same as the IOleInPlaceFrame::TranslateAccelerator, but will be
  1656. //  never called because we don't support EXEs (i.e., the explorer has
  1657. //  the message loop). This member function is defined here for possible
  1658. //  future enhancement.
  1659. //
  1660. //
  1661. // IShellBrowser::BrowseObject(pidl, wFlags)
  1662. //
  1663. //   The view calls this member to let shell explorer browse to another
  1664. //  folder. The pidl and wFlags specifies the folder to be browsed.
  1665. //
  1666. //  Following three flags specifies whether it creates another window or not.
  1667. //   SBSP_SAMEBROWSER  -- Browse to another folder with the same window.
  1668. //   SBSP_NEWBROWSER   -- Creates another window for the specified folder.
  1669. //   SBSP_DEFBROWSER   -- Default behavior (respects the view option).
  1670. //
  1671. //  Following three flags specifies open, explore, or default mode. These   .
  1672. //  are ignored if SBSP_SAMEBROWSER or (SBSP_DEFBROWSER && (single window   .
  1673. //  browser || explorer)).                                                  .
  1674. //   SBSP_OPENMODE     -- Use a normal folder window
  1675. //   SBSP_EXPLOREMODE  -- Use an explorer window
  1676. //   SBSP_DEFMODE      -- Use the same as the current window
  1677. //
  1678. //  Following three flags specifies the pidl.
  1679. //   SBSP_ABSOLUTE -- pidl is an absolute pidl (relative from desktop)
  1680. //   SBSP_RELATIVE -- pidl is relative from the current folder.
  1681. //   SBSP_PARENT   -- Browse the parent folder (ignores the pidl)
  1682. //   SBSP_NAVIGATEBACK    -- Navigate back (ignores the pidl)
  1683. //   SBSP_NAVIGATEFORWARD -- Navigate forward (ignores the pidl)
  1684. //
  1685. //  Following two flags control history manipulation as result of navigate
  1686. //   SBSP_WRITENOHISTORY -- write no history (shell folder) entry
  1687. //   SBSP_NOAUTOSELECT -- suppress selection in history pane
  1688. //
  1689. // IShellBrowser::GetViewStateStream(grfMode, ppstm)
  1690. //
  1691. //   The browser returns an IStream interface as the storage for view
  1692. //  specific state information.
  1693. //
  1694. //   grfMode -- Specifies the read/write access (STGM_READ/WRITE/READWRITE)
  1695. //   ppstm   -- Specifies the LPSTREAM variable to be filled.
  1696. //
  1697. //
  1698. // IShellBrowser::GetControlWindow(id, phwnd)
  1699. //
  1700. //   The shell view may call this member function to get the window handle
  1701. //  of Explorer controls (toolbar or status winodw -- FCW_TOOLBAR or
  1702. //  FCW_STATUS).
  1703. //
  1704. //
  1705. // IShellBrowser::SendControlMsg(id, uMsg, wParam, lParam, pret)
  1706. //
  1707. //   The shell view calls this member function to send control messages to
  1708. //  one of Explorer controls (toolbar or status window -- FCW_TOOLBAR or
  1709. //  FCW_STATUS).
  1710. //
  1711. //
  1712. // IShellBrowser::QueryActiveShellView(IShellView * ppshv)
  1713. //
  1714. //   This member returns currently activated (displayed) shellview object.
  1715. //  A shellview never need to call this member function.
  1716. //
  1717. //
  1718. // IShellBrowser::OnViewWindowActive(pshv)
  1719. //
  1720. //   The shell view window calls this member function when the view window
  1721. //  (or one of its children) got the focus. It MUST call this member before
  1722. //  calling IShellBrowser::InsertMenus, because it will insert different
  1723. //  set of menu items depending on whether the view has the focus or not.
  1724. //
  1725. //
  1726. // IShellBrowser::SetToolbarItems(lpButtons, nButtons, uFlags)
  1727. //
  1728. //   The view calls this function to add toolbar items to the exporer's
  1729. //  toolbar. "lpButtons" and "nButtons" specifies the array of toolbar
  1730. //  items. "uFlags" must be one of FCT_MERGE, FCT_CONFIGABLE, FCT_ADDTOEND.
  1731. //
  1732. //-------------------------------------------------------------------------
  1733.  
  1734. //
  1735. // Values for wFlags parameter of ISB::BrowseObject() member.
  1736. //
  1737. #define SBSP_DEFBROWSER         0x0000
  1738. #define SBSP_SAMEBROWSER        0x0001
  1739. #define SBSP_NEWBROWSER         0x0002
  1740.  
  1741. #define SBSP_DEFMODE            0x0000
  1742. #define SBSP_OPENMODE           0x0010
  1743. #define SBSP_EXPLOREMODE        0x0020
  1744.  
  1745. #define SBSP_ABSOLUTE           0x0000
  1746. #define SBSP_RELATIVE           0x1000
  1747. #define SBSP_PARENT             0x2000
  1748. #define SBSP_NAVIGATEBACK       0x4000
  1749. #define SBSP_NAVIGATEFORWARD    0x8000
  1750.  
  1751. #define SBSP_ALLOW_AUTONAVIGATE 0x10000
  1752.  
  1753. #define SBSP_INITIATEDBYHLINKFRAME        0x80000000
  1754. #define SBSP_REDIRECT                     0x40000000
  1755.  
  1756. #define SBSP_WRITENOHISTORY     0x08000000
  1757. #define SBSP_NOAUTOSELECT       0x04000000
  1758.  
  1759.  
  1760. //
  1761. // Values for id parameter of ISB::GetWindow/SendControlMsg members.
  1762. //
  1763. // WARNING:
  1764. //  Any shell extensions which sends messages to those control windows
  1765. // might not work in the future version of windows. If you really need
  1766. // to send messages to them, (1) don't assume that those control window
  1767. // always exist (i.e. GetControlWindow may fail) and (2) verify the window
  1768. // class of the window before sending any messages.
  1769. //
  1770. #define FCW_STATUS      0x0001
  1771. #define FCW_TOOLBAR     0x0002
  1772. #define FCW_TREE        0x0003
  1773. #define FCW_INTERNETBAR 0x0006
  1774. #define FCW_PROGRESS    0x0008
  1775.  
  1776. #if (_WIN32_IE >= 0x0400)
  1777. #endif
  1778.  
  1779. //
  1780. // Values for uFlags paremeter of ISB::SetToolbarItems member.
  1781. //
  1782. #define FCT_MERGE       0x0001
  1783. #define FCT_CONFIGABLE  0x0002
  1784. #define FCT_ADDTOEND    0x0004
  1785.  
  1786.  
  1787. #undef  INTERFACE
  1788. #define INTERFACE   IShellBrowser
  1789.  
  1790. DECLARE_INTERFACE_(IShellBrowser, IOleWindow)
  1791. {
  1792.     // *** IUnknown methods ***
  1793.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1794.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1795.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1796.  
  1797.     // *** IOleWindow methods ***
  1798.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  1799.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  1800.  
  1801.     // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
  1802.     STDMETHOD(InsertMenusSB) (THIS_ HMENU hmenuShared,
  1803.                                 LPOLEMENUGROUPWIDTHS lpMenuWidths) PURE;
  1804.     STDMETHOD(SetMenuSB) (THIS_ HMENU hmenuShared, HOLEMENU holemenuReserved,
  1805.                 HWND hwndActiveObject) PURE;
  1806.     STDMETHOD(RemoveMenusSB) (THIS_ HMENU hmenuShared) PURE;
  1807.     STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR lpszStatusText) PURE;
  1808.     STDMETHOD(EnableModelessSB) (THIS_ BOOL fEnable) PURE;
  1809.     STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG lpmsg, WORD wID) PURE;
  1810.  
  1811.     // *** IShellBrowser methods ***
  1812.     STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT wFlags) PURE;
  1813.     STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode,
  1814.                 LPSTREAM  *ppStrm) PURE;
  1815.     STDMETHOD(GetControlWindow)(THIS_ UINT id, HWND * lphwnd) PURE;
  1816.     STDMETHOD(SendControlMsg)(THIS_ UINT id, UINT uMsg, WPARAM wParam,
  1817.                 LPARAM lParam, LRESULT * pret) PURE;
  1818.     STDMETHOD(QueryActiveShellView)(THIS_ struct IShellView ** ppshv) PURE;
  1819.     STDMETHOD(OnViewWindowActive)(THIS_ struct IShellView * ppshv) PURE;
  1820.     STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT nButtons,
  1821.                 UINT uFlags) PURE;
  1822. };
  1823. #define __IShellBrowser_INTERFACE_DEFINED__
  1824.  
  1825. typedef IShellBrowser * LPSHELLBROWSER;
  1826.  
  1827. enum {
  1828.     SBSC_HIDE = 0,
  1829.     SBSC_SHOW = 1,
  1830.     SBSC_TOGGLE = 2,
  1831.     SBSC_QUERY =  3
  1832. };
  1833.  
  1834. enum {
  1835.         SBO_DEFAULT = 0 ,
  1836.         SBO_NOBROWSERPAGES = 1
  1837. };
  1838.  
  1839.  
  1840. #if (_WIN32_IE >= 0x0400)
  1841. #endif
  1842.  
  1843. //-------------------------------------------------------------------------
  1844. // ICommDlgBrowser interface
  1845. //
  1846. //  ICommDlgBrowser interface is the interface that is provided by the new
  1847. // common dialog window to hook and modify the behavior of IShellView.  When
  1848. // a default view is created, it queries its parent IShellBrowser for the
  1849. // ICommDlgBrowser interface.  If supported, it calls out to that interface
  1850. // in several cases that need to behave differently in a dialog.
  1851. //
  1852. // Member functions:
  1853. //
  1854. //  ICommDlgBrowser::OnDefaultCommand()
  1855. //    Called when the user double-clicks in the view or presses Enter.  The
  1856. //   browser should return S_OK if it processed the action itself, S_FALSE
  1857. //   to let the view perform the default action.
  1858. //
  1859. //  ICommDlgBrowser::OnStateChange(ULONG uChange)
  1860. //    Called when some states in the view change.  'uChange' is one of the
  1861. //   CDBOSC_* values.  This call is made after the state (selection, focus,
  1862. //   etc) has changed.  There is no return value.
  1863. //
  1864. //  ICommDlgBrowser::IncludeObject(LPCITEMIDLIST pidl)
  1865. //    Called when the view is enumerating objects.  'pidl' is a relative
  1866. //   IDLIST.  The browser should return S_OK to include the object in the
  1867. //   view, S_FALSE to hide it
  1868. //
  1869. //-------------------------------------------------------------------------
  1870.  
  1871. #define CDBOSC_SETFOCUS     0x00000000
  1872. #define CDBOSC_KILLFOCUS    0x00000001
  1873. #define CDBOSC_SELCHANGE    0x00000002
  1874. #define CDBOSC_RENAME       0x00000003
  1875.  
  1876. #undef  INTERFACE
  1877. #define INTERFACE   ICommDlgBrowser
  1878.  
  1879. DECLARE_INTERFACE_(ICommDlgBrowser, IUnknown)
  1880. {
  1881.     // *** IUnknown methods ***
  1882.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1883.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1884.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1885.  
  1886.     // *** ICommDlgBrowser methods ***
  1887.     STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1888.     STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1889.                 ULONG uChange) PURE;
  1890.     STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1891.                 LPCITEMIDLIST pidl) PURE;
  1892. };
  1893.  
  1894. typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
  1895.  
  1896.  
  1897. //==========================================================================
  1898. //
  1899. // Interface:   IShellView
  1900. //
  1901. // IShellView::GetWindow(phwnd)
  1902. //
  1903. //   Inherited from IOleWindow::GetWindow.
  1904. //
  1905. //
  1906. // IShellView::ContextSensitiveHelp(fEnterMode)
  1907. //
  1908. //   Inherited from IOleWindow::ContextSensitiveHelp.
  1909. //
  1910. //
  1911. // IShellView::TranslateAccelerator(lpmsg)
  1912. //
  1913. //   Similar to IOleInPlaceActiveObject::TranlateAccelerator. The explorer
  1914. //  calls this function BEFORE any other translation. Returning S_OK
  1915. //  indicates that the message was translated (eaten) and should not be
  1916. //  translated or dispatched by the explorer.
  1917. //
  1918. //
  1919. // IShellView::EnableModeless(fEnable)
  1920. //   Similar to IOleInPlaceActiveObject::EnableModeless.
  1921. //
  1922. //
  1923. // IShellView::UIActivate(uState)
  1924. //
  1925. //   The explorer calls this member function whenever the activation
  1926. //  state of the view window is changed by a certain event that is
  1927. //  NOT caused by the shell view itself.
  1928. //
  1929. //   SVUIA_DEACTIVATE will be passed when the explorer is about to
  1930. //  destroy the shell view window; the shell view is supposed to remove
  1931. //  all the extended UIs (typically merged menu and modeless popup windows).
  1932. //
  1933. //   SVUIA_ACTIVATE_NOFOCUS will be passsed when the shell view is losing
  1934. //  the input focus or the shell view has been just created without the
  1935. //  input focus; the shell view is supposed to set menuitems appropriate
  1936. //  for non-focused state (no selection specific items should be added).
  1937. //
  1938. //   SVUIA_ACTIVATE_FOCUS will be passed when the explorer has just
  1939. //  created the view window with the input focus; the shell view is
  1940. //  supposed to set menuitems appropriate for focused state.
  1941. //
  1942. //   SVUIA_INPLACEACTIVATE(new) will be passed when the shell view is opened
  1943. //  within an ActiveX control, which is not a UI active. In this case,
  1944. //  the shell view should not merge menus or put toolbas. To be compatible
  1945. //  with Win95 client, we don't pass this value unless the view supports
  1946. //  IShellView2.
  1947. //
  1948. //   The shell view should not change focus within this member function.
  1949. //  The shell view should not hook the WM_KILLFOCUS message to remerge
  1950. //  menuitems. However, the shell view typically hook the WM_SETFOCUS
  1951. //  message, and re-merge the menu after calling IShellBrowser::
  1952. //  OnViewWindowActivated.
  1953. //
  1954. //
  1955. // IShellView::Refresh()
  1956. //
  1957. //   The explorer calls this member when the view needs to refresh its
  1958. //  contents (such as when the user hits F5 key).
  1959. //
  1960. //
  1961. // IShellView::CreateViewWindow
  1962. //
  1963. //   This member creates the view window (right-pane of the explorer or the
  1964. //  client window of the folder window).
  1965. //
  1966. //
  1967. // IShellView::DestroyViewWindow
  1968. //
  1969. //   This member destroys the view window.
  1970. //
  1971. //
  1972. // IShellView::GetCurrentInfo
  1973. //
  1974. //   This member returns the folder settings.
  1975. //
  1976. //
  1977. // IShellView::AddPropertySHeetPages
  1978. //
  1979. //   The explorer calls this member when it is opening the option property
  1980. //  sheet. This allows the view to add additional pages to it.
  1981. //
  1982. //
  1983. // IShellView::SaveViewState()
  1984. //
  1985. //   The explorer calls this member when the shell view is supposed to
  1986. //  store its view settings. The shell view is supposed to get a view
  1987. //  stream by calling IShellBrowser::GetViewStateStream and store the
  1988. //  current view state into that stream.
  1989. //
  1990. //
  1991. // IShellView::SelectItem(pidlItem, uFlags)
  1992. //
  1993. //   The explorer calls this member to change the selection state of
  1994. //  item(s) within the shell view window.  If pidlItem is NULL and uFlags
  1995. //  is SVSI_DESELECTOTHERS, all items should be deselected.
  1996. //
  1997. //-------------------------------------------------------------------------
  1998.  
  1999. //
  2000. // shellview select item flags
  2001. //
  2002. #define SVSI_DESELECT   0x0000
  2003. #define SVSI_SELECT     0x0001
  2004. #define SVSI_EDIT       0x0003  // includes select
  2005. #define SVSI_DESELECTOTHERS 0x0004
  2006. #define SVSI_ENSUREVISIBLE  0x0008
  2007. #define SVSI_FOCUSED        0x0010
  2008. #define SVSI_TRANSLATEPT    0x0020
  2009.  
  2010. //
  2011. // shellview get item object flags
  2012. //
  2013. #define SVGIO_BACKGROUND    0x00000000
  2014. #define SVGIO_SELECTION     0x00000001
  2015. #define SVGIO_ALLVIEW       0x00000002
  2016.  
  2017. //
  2018. // uState values for IShellView::UIActivate
  2019. //
  2020. typedef enum {
  2021.     SVUIA_DEACTIVATE       = 0,
  2022.     SVUIA_ACTIVATE_NOFOCUS = 1,
  2023.     SVUIA_ACTIVATE_FOCUS   = 2,
  2024.     SVUIA_INPLACEACTIVATE  = 3          // new flag for IShellView2
  2025. } SVUIA_STATUS;
  2026.  
  2027. #undef  INTERFACE
  2028. #define INTERFACE   IShellView
  2029.  
  2030. DECLARE_INTERFACE_(IShellView, IOleWindow)
  2031. {
  2032.     // *** IUnknown methods ***
  2033.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2034.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2035.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2036.  
  2037.     // *** IOleWindow methods ***
  2038.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2039.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2040.  
  2041.     // *** IShellView methods ***
  2042.     STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE;
  2043. #ifdef _FIX_ENABLEMODELESS_CONFLICT
  2044.     STDMETHOD(EnableModelessSV) (THIS_ BOOL fEnable) PURE;
  2045. #else
  2046.     STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  2047. #endif
  2048.     STDMETHOD(UIActivate) (THIS_ UINT uState) PURE;
  2049.     STDMETHOD(Refresh) (THIS) PURE;
  2050.  
  2051.     STDMETHOD(CreateViewWindow)(THIS_ IShellView  *lpPrevView,
  2052.                     LPCFOLDERSETTINGS lpfs, IShellBrowser  * psb,
  2053.                     RECT * prcView, HWND  *phWnd) PURE;
  2054.     STDMETHOD(DestroyViewWindow)(THIS) PURE;
  2055.     STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
  2056.     STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,
  2057.                     LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
  2058.     STDMETHOD(SaveViewState)(THIS) PURE;
  2059.     STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT uFlags) PURE;
  2060.     STDMETHOD(GetItemObject)(THIS_ UINT uItem, REFIID riid,
  2061.                     LPVOID *ppv) PURE;
  2062. };
  2063.  
  2064. typedef IShellView *    LPSHELLVIEW;
  2065.  
  2066. typedef GUID SHELLVIEWID;
  2067.  
  2068. #define SV2GV_CURRENTVIEW ((UINT)-1)
  2069. #define SV2GV_DEFAULTVIEW ((UINT)-2)
  2070.  
  2071. typedef struct _SV2CVW2_PARAMS
  2072. {
  2073.     DWORD cbSize;
  2074.  
  2075.     IShellView *psvPrev;
  2076.     FOLDERSETTINGS const *pfs;
  2077.     IShellBrowser *psbOwner;
  2078.     RECT *prcView;
  2079.     SHELLVIEWID const *pvid;
  2080.  
  2081.     HWND hwndView;
  2082. } SV2CVW2_PARAMS;
  2083. typedef SV2CVW2_PARAMS *LPSV2CVW2_PARAMS;
  2084.  
  2085. #undef  INTERFACE
  2086. #define INTERFACE   IShellView2
  2087.  
  2088. DECLARE_INTERFACE_(IShellView2, IShellView)
  2089. {
  2090.     // *** IUnknown methods ***
  2091.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2092.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2093.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2094.  
  2095.     // *** IOleWindow methods ***
  2096.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2097.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2098.  
  2099.     // *** IShellView methods ***
  2100.     STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE;
  2101. #ifdef _FIX_ENABLEMODELESS_CONFLICT
  2102.     STDMETHOD(EnableModelessSV) (THIS_ BOOL fEnable) PURE;
  2103. #else
  2104.     STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  2105. #endif
  2106.     STDMETHOD(UIActivate) (THIS_ UINT uState) PURE;
  2107.     STDMETHOD(Refresh) (THIS) PURE;
  2108.  
  2109.     STDMETHOD(CreateViewWindow)(THIS_ IShellView  *lpPrevView,
  2110.                     LPCFOLDERSETTINGS lpfs, IShellBrowser  * psb,
  2111.                     RECT * prcView, HWND  *phWnd) PURE;
  2112.     STDMETHOD(DestroyViewWindow)(THIS) PURE;
  2113.     STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
  2114.     STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,
  2115.                     LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
  2116.     STDMETHOD(SaveViewState)(THIS) PURE;
  2117.     STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT uFlags) PURE;
  2118.     STDMETHOD(GetItemObject)(THIS_ UINT uItem, REFIID riid,
  2119.                     LPVOID *ppv) PURE;
  2120.  
  2121.     // *** IShellView2 methods ***
  2122.     STDMETHOD(GetView)(THIS_ SHELLVIEWID* pvid, ULONG uView) PURE;
  2123.     STDMETHOD(CreateViewWindow2)(THIS_ LPSV2CVW2_PARAMS lpParams) PURE;
  2124.     STDMETHOD(HandleRename)(THIS_ LPCITEMIDLIST pidlNew) PURE;
  2125.     STDMETHOD(SelectAndPositionItem) (THIS_ LPCITEMIDLIST pidlItem,
  2126.         UINT uFlags,POINT* point) PURE; 
  2127. };
  2128.  
  2129. //-------------------------------------------------------------------------
  2130. //
  2131. // struct STRRET
  2132. //
  2133. // structure for returning strings from IShellFolder member functions
  2134. //
  2135. //-------------------------------------------------------------------------
  2136. #define STRRET_WSTR     0x0000          // Use STRRET.pOleStr
  2137. #define STRRET_OFFSET   0x0001          // Use STRRET.uOffset to Ansi
  2138. #define STRRET_CSTR     0x0002          // Use STRRET.cStr
  2139.  
  2140.  
  2141. typedef struct _STRRET
  2142. {
  2143.     UINT uType; // One of the STRRET_* values
  2144.     union
  2145.     {
  2146.         LPWSTR          pOleStr;        // must be freed by caller of GetDisplayNameOf
  2147.         LPSTR           pStr;           // NOT USED
  2148.         UINT            uOffset;        // Offset into SHITEMID
  2149.         char            cStr[MAX_PATH]; // Buffer to fill in (ANSI)
  2150.     } DUMMYUNIONNAME;
  2151. } STRRET, *LPSTRRET;
  2152.  
  2153.  
  2154. //-------------------------------------------------------------------------
  2155. //
  2156. // SHGetPathFromIDList
  2157. //
  2158. //  This function assumes the size of the buffer (MAX_PATH). The pidl
  2159. // should point to a file system object.
  2160. //
  2161. //-------------------------------------------------------------------------
  2162.  
  2163. WINSHELLAPI BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath);
  2164. WINSHELLAPI BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath);
  2165.  
  2166. #ifdef UNICODE
  2167. #define SHGetPathFromIDList SHGetPathFromIDListW
  2168. #else
  2169. #define SHGetPathFromIDList SHGetPathFromIDListA
  2170. #endif
  2171.  
  2172.  
  2173. //-------------------------------------------------------------------------
  2174. //
  2175. // SHGetSpecialFolderLocation
  2176. //
  2177. //  Caller should use SHGetMalloc to obtain an allocator that can free the pidl
  2178. //  
  2179. //
  2180. //-------------------------------------------------------------------------
  2181. //
  2182. // registry entries for special paths are kept in :
  2183. #define REGSTR_PATH_SPECIAL_FOLDERS    REGSTR_PATH_EXPLORER TEXT("\\Shell Folders")
  2184.  
  2185.  
  2186. #define CSIDL_DESKTOP                   0x0000
  2187. #define CSIDL_INTERNET                  0x0001
  2188. #define CSIDL_PROGRAMS                  0x0002
  2189. #define CSIDL_CONTROLS                  0x0003
  2190. #define CSIDL_PRINTERS                  0x0004
  2191. #define CSIDL_PERSONAL                  0x0005
  2192. #define CSIDL_FAVORITES                 0x0006
  2193. #define CSIDL_STARTUP                   0x0007
  2194. #define CSIDL_RECENT                    0x0008
  2195. #define CSIDL_SENDTO                    0x0009
  2196. #define CSIDL_BITBUCKET                 0x000a
  2197. #define CSIDL_STARTMENU                 0x000b
  2198. #define CSIDL_DESKTOPDIRECTORY          0x0010
  2199. #define CSIDL_DRIVES                    0x0011
  2200. #define CSIDL_NETWORK                   0x0012
  2201. #define CSIDL_NETHOOD                   0x0013
  2202. #define CSIDL_FONTS                     0x0014
  2203. #define CSIDL_TEMPLATES                 0x0015
  2204. #define CSIDL_COMMON_STARTMENU          0x0016
  2205. #define CSIDL_COMMON_PROGRAMS           0X0017
  2206. #define CSIDL_COMMON_STARTUP            0x0018
  2207. #define CSIDL_COMMON_DESKTOPDIRECTORY   0x0019
  2208. #define CSIDL_APPDATA                   0x001a
  2209. #define CSIDL_PRINTHOOD                 0x001b
  2210. #define CSIDL_ALTSTARTUP                0x001d         // DBCS
  2211. #define CSIDL_COMMON_ALTSTARTUP         0x001e         // DBCS
  2212. #define CSIDL_COMMON_FAVORITES          0x001f
  2213. #define CSIDL_INTERNET_CACHE            0x0020
  2214. #define CSIDL_COOKIES                   0x0021
  2215. #define CSIDL_HISTORY                   0x0022
  2216.  
  2217. WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, int nFolder, LPITEMIDLIST * ppidl);
  2218.  
  2219. #if (_WIN32_IE >= 0x0400)
  2220.  
  2221. WINSHELLAPI BOOL WINAPI SHGetSpecialFolderPathA(HWND hwndOwner, LPSTR lpszPath, int nFolder, BOOL fCreate);
  2222. WINSHELLAPI BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR lpszPath, int nFolder, BOOL fCreate);
  2223. #ifdef UNICODE
  2224. #define SHGetSpecialFolderPath  SHGetSpecialFolderPathW
  2225. #else
  2226. #define SHGetSpecialFolderPath  SHGetSpecialFolderPathA
  2227. #endif
  2228.  
  2229. #endif      // _WIN32_IE >= 0x0400
  2230.  
  2231. //-------------------------------------------------------------------------
  2232. //
  2233. // SHBrowseForFolder API
  2234. //
  2235. //-------------------------------------------------------------------------
  2236.  
  2237. typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  2238.  
  2239. typedef struct _browseinfoA {
  2240.     HWND        hwndOwner;
  2241.     LPCITEMIDLIST pidlRoot;
  2242.     LPSTR        pszDisplayName;// Return display name of item selected.
  2243.     LPCSTR       lpszTitle;      // text to go in the banner over the tree.
  2244.     UINT         ulFlags;       // Flags that control the return stuff
  2245.     BFFCALLBACK  lpfn;
  2246.     LPARAM      lParam;         // extra info that's passed back in callbacks
  2247.  
  2248.     int          iImage;      // output var: where to return the Image index.
  2249. } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
  2250.  
  2251. typedef struct _browseinfoW {
  2252.     HWND        hwndOwner;
  2253.     LPCITEMIDLIST pidlRoot;
  2254.     LPWSTR       pszDisplayName;// Return display name of item selected.
  2255.     LPCWSTR      lpszTitle;      // text to go in the banner over the tree.
  2256.     UINT         ulFlags;       // Flags that control the return stuff
  2257.     BFFCALLBACK  lpfn;
  2258.     LPARAM      lParam;         // extra info that's passed back in callbacks
  2259.  
  2260.     int          iImage;      // output var: where to return the Image index.
  2261. } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
  2262.  
  2263. #ifdef UNICODE
  2264. #define BROWSEINFO      BROWSEINFOW
  2265. #define PBROWSEINFO     PBROWSEINFOW
  2266. #define LPBROWSEINFO    LPBROWSEINFOW
  2267. #else
  2268. #define BROWSEINFO      BROWSEINFOA
  2269. #define PBROWSEINFO     PBROWSEINFOA
  2270. #define LPBROWSEINFO    LPBROWSEINFOA
  2271. #endif
  2272.  
  2273. // Browsing for directory.
  2274. #define BIF_RETURNONLYFSDIRS   0x0001  // For finding a folder to start document searching
  2275. #define BIF_DONTGOBELOWDOMAIN  0x0002  // For starting the Find Computer
  2276. #define BIF_STATUSTEXT         0x0004
  2277. #define BIF_RETURNFSANCESTORS  0x0008
  2278. #define BIF_EDITBOX            0x0010
  2279. #define BIF_VALIDATE           0x0020   // insist on valid result (or CANCEL)
  2280.  
  2281. #define BIF_BROWSEFORCOMPUTER  0x1000  // Browsing for Computers.
  2282. #define BIF_BROWSEFORPRINTER   0x2000  // Browsing for Printers
  2283. #define BIF_BROWSEINCLUDEFILES 0x4000  // Browsing for Everything
  2284.  
  2285. // message from browser
  2286. #define BFFM_INITIALIZED        1
  2287. #define BFFM_SELCHANGED         2
  2288. #define BFFM_VALIDATEFAILEDA    3   // lParam:szPath ret:1(cont),0(EndDialog)
  2289. #define BFFM_VALIDATEFAILEDW    4   // lParam:wzPath ret:1(cont),0(EndDialog)
  2290.  
  2291. // messages to browser
  2292. #define BFFM_SETSTATUSTEXTA     (WM_USER + 100)
  2293. #define BFFM_ENABLEOK           (WM_USER + 101)
  2294. #define BFFM_SETSELECTIONA      (WM_USER + 102)
  2295. #define BFFM_SETSELECTIONW      (WM_USER + 103)
  2296. #define BFFM_SETSTATUSTEXTW     (WM_USER + 104)
  2297.  
  2298. WINSHELLAPI LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi);
  2299. WINSHELLAPI LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
  2300.  
  2301. #ifdef UNICODE
  2302. #define SHBrowseForFolder   SHBrowseForFolderW
  2303. #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTW
  2304. #define BFFM_SETSELECTION   BFFM_SETSELECTIONW
  2305.  
  2306. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
  2307. #else
  2308. #define SHBrowseForFolder   SHBrowseForFolderA
  2309. #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTA
  2310. #define BFFM_SETSELECTION   BFFM_SETSELECTIONA
  2311.  
  2312. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
  2313. #endif
  2314.  
  2315. //-------------------------------------------------------------------------
  2316. //
  2317. // SHLoadInProc
  2318. //
  2319. //   When this function is called, the shell calls CoCreateInstance
  2320. //  (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
  2321. //  from within the shell's process and release it immediately.
  2322. //
  2323. //-------------------------------------------------------------------------
  2324.  
  2325. WINSHELLAPI HRESULT WINAPI SHLoadInProc(REFCLSID rclsid);
  2326.  
  2327.  
  2328. //-------------------------------------------------------------------------
  2329. //
  2330. // IEnumIDList interface
  2331. //
  2332. //  IShellFolder::EnumObjects member returns an IEnumIDList object.
  2333. //
  2334. //-------------------------------------------------------------------------
  2335.  
  2336. typedef struct IEnumIDList      *LPENUMIDLIST;
  2337.  
  2338. #undef  INTERFACE
  2339. #define INTERFACE       IEnumIDList
  2340.  
  2341. DECLARE_INTERFACE_(IEnumIDList, IUnknown)
  2342. {
  2343.     // *** IUnknown methods ***
  2344.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2345.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2346.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2347.  
  2348.     // *** IEnumIDList methods ***
  2349.     STDMETHOD(Next)  (THIS_ ULONG celt,
  2350.                       LPITEMIDLIST *rgelt,
  2351.                       ULONG *pceltFetched) PURE;
  2352.     STDMETHOD(Skip)  (THIS_ ULONG celt) PURE;
  2353.     STDMETHOD(Reset) (THIS) PURE;
  2354.     STDMETHOD(Clone) (THIS_ IEnumIDList **ppenum) PURE;
  2355. };
  2356.  
  2357.  
  2358. //-------------------------------------------------------------------------
  2359. //
  2360. // IShellFolder interface
  2361. //
  2362. //
  2363. // [Member functions]
  2364. //
  2365. // IShellFolder::BindToObject(pidl, pbc, riid, ppvOut)
  2366. //   This function returns an instance of a sub-folder which is specified
  2367. //  by the IDList (pidl).
  2368. //
  2369. // IShellFolder::BindToStorage(pidl, pbc, riid, ppvObj)
  2370. //   This function returns a storage instance of a sub-folder which is
  2371. //  specified by the IDList (pidl). The shell never calls this member
  2372. //  function in the first release of Win95.
  2373. //
  2374. // IShellFolder::CompareIDs(lParam, pidl1, pidl2)
  2375. //   This function compares two IDLists and returns the result. The shell
  2376. //  explorer always passes 0 as lParam, which indicates "sort by name".
  2377. //  It should return 0 (as CODE of the scode), if two id indicates the
  2378. //  same object; negative value if pidl1 should be placed before pidl2;
  2379. //  positive value if pidl2 should be placed before pidl1.
  2380. //
  2381. // IShellFolder::CreateViewObject(hwndOwner, riid, ppvOut)
  2382. //   This function creates a view object of the folder itself. The view
  2383. //  object is a difference instance from the shell folder object.
  2384. //   "hwndOwner" can be used  as the owner window of its dialog box or
  2385. //  menu during the lifetime of the view object.
  2386. //  instance which has only one reference count. The explorer may create
  2387. //  more than one instances of view object from one shell folder object
  2388. //  and treat them as separate instances.
  2389. //
  2390. // IShellFolder::GetAttributesOf(cidl, apidl, prgfInOut)
  2391. //   This function returns the attributes of specified objects in that
  2392. //  folder. "cidl" and "apidl" specifies objects. "apidl" contains only
  2393. //  simple IDLists. The explorer initializes *prgfInOut with a set of
  2394. //  flags to be evaluated. The shell folder may optimize the operation
  2395. //  by not returning unspecified flags.
  2396. //
  2397. // IShellFolder::GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut)
  2398. //   This function creates a UI object to be used for specified objects.
  2399. //  The shell explorer passes either IID_IDataObject (for transfer operation)
  2400. //  or IID_IContextMenu (for context menu operation) as riid.
  2401. //
  2402. // IShellFolder::GetDisplayNameOf
  2403. //   This function returns the display name of the specified object.
  2404. //  If the ID contains the display name (in the locale character set),
  2405. //  it returns the offset to the name. Otherwise, it returns a pointer
  2406. //  to the display name string (UNICODE), which is allocated by the
  2407. //  task allocator, or fills in a buffer.
  2408. //
  2409. // IShellFolder::SetNameOf
  2410. //   This function sets the display name of the specified object.
  2411. //  If it changes the ID as well, it returns the new ID which is
  2412. //  alocated by the task allocator.
  2413. //
  2414. //-------------------------------------------------------------------------
  2415.  
  2416. // IShellFolder::GetDisplayNameOf/SetNameOf uFlags
  2417. typedef enum tagSHGDN
  2418. {
  2419.     SHGDN_NORMAL            = 0,        // default (display purpose)
  2420.     SHGDN_INFOLDER          = 1,        // displayed under a folder (relative)
  2421.     SHGDN_INCLUDE_NONFILESYS = 0x2000,   // if not set, display names for shell name space items that are not in the file system will fail.
  2422.     SHGDN_FORADDRESSBAR     = 0x4000,   // for displaying in the address (drives dropdown) bar
  2423.     SHGDN_FORPARSING        = 0x8000,   // for ParseDisplayName or path
  2424. } SHGNO;
  2425.  
  2426. // IShellFolder::EnumObjects
  2427. typedef enum tagSHCONTF
  2428. {
  2429.     SHCONTF_FOLDERS         = 32,       // for shell browser
  2430.     SHCONTF_NONFOLDERS      = 64,       // for default view
  2431.     SHCONTF_INCLUDEHIDDEN   = 128,      // for hidden/system objects
  2432. } SHCONTF;
  2433.  
  2434. // IShellFolder::GetAttributesOf flags
  2435. #define SFGAO_CANCOPY           DROPEFFECT_COPY // Objects can be copied
  2436. #define SFGAO_CANMOVE           DROPEFFECT_MOVE // Objects can be moved
  2437. #define SFGAO_CANLINK           DROPEFFECT_LINK // Objects can be linked
  2438. #define SFGAO_CANRENAME         0x00000010L     // Objects can be renamed
  2439. #define SFGAO_CANDELETE         0x00000020L     // Objects can be deleted
  2440. #define SFGAO_HASPROPSHEET      0x00000040L     // Objects have property sheets
  2441. #define SFGAO_DROPTARGET        0x00000100L     // Objects are drop target
  2442. #define SFGAO_CAPABILITYMASK    0x00000177L
  2443. #define SFGAO_LINK              0x00010000L     // Shortcut (link)
  2444. #define SFGAO_SHARE             0x00020000L     // shared
  2445. #define SFGAO_READONLY          0x00040000L     // read-only
  2446. #define SFGAO_GHOSTED           0x00080000L     // ghosted icon
  2447. #define SFGAO_HIDDEN            0x00080000L     // hidden object
  2448. #define SFGAO_DISPLAYATTRMASK   0x000F0000L
  2449. #define SFGAO_FILESYSANCESTOR   0x10000000L     // It contains file system folder
  2450. #define SFGAO_FOLDER            0x20000000L     // It's a folder.
  2451. #define SFGAO_FILESYSTEM        0x40000000L     // is a file system thing (file/folder/root)
  2452. #define SFGAO_HASSUBFOLDER      0x80000000L     // Expandable in the map pane
  2453. #define SFGAO_CONTENTSMASK      0x80000000L
  2454. #define SFGAO_VALIDATE          0x01000000L     // invalidate cached information
  2455. #define SFGAO_REMOVABLE         0x02000000L     // is this removeable media?
  2456. #define SFGAO_COMPRESSED        0x04000000L     // Object is compressed (use alt color)
  2457. #define SFGAO_BROWSABLE         0x08000000L     // is in-place browsable
  2458. #define SFGAO_NONENUMERATED     0x00100000L     // is a non-enumerated object
  2459. #define SFGAO_NEWCONTENT        0x00200000L     // should show bold in explorer tree
  2460.  
  2461. #undef  INTERFACE
  2462. #define INTERFACE       IShellFolder
  2463.  
  2464. DECLARE_INTERFACE_(IShellFolder, IUnknown)
  2465. {
  2466.     // *** IUnknown methods ***
  2467.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2468.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2469.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2470.  
  2471.     // *** IShellFolder methods ***
  2472.     STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner,
  2473.         LPBC pbcReserved, LPOLESTR lpszDisplayName,
  2474.         ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  2475.  
  2476.     STDMETHOD(EnumObjects) ( THIS_ HWND hwndOwner, DWORD grfFlags, LPENUMIDLIST * ppenumIDList) PURE;
  2477.  
  2478.     STDMETHOD(BindToObject)     (THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,
  2479.                                  REFIID riid, LPVOID * ppvOut) PURE;
  2480.     STDMETHOD(BindToStorage)    (THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,
  2481.                                  REFIID riid, LPVOID * ppvObj) PURE;
  2482.     STDMETHOD(CompareIDs)       (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  2483.     STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, LPVOID * ppvOut) PURE;
  2484.     STDMETHOD(GetAttributesOf)  (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  2485.                                     ULONG * rgfInOut) PURE;
  2486.     STDMETHOD(GetUIObjectOf)    (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  2487.                                  REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) PURE;
  2488.     STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  2489.     STDMETHOD(SetNameOf)        (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  2490.                                  LPCOLESTR lpszName, DWORD uFlags,
  2491.                                  LPITEMIDLIST * ppidlOut) PURE;
  2492. };
  2493.  
  2494. typedef IShellFolder * LPSHELLFOLDER;
  2495.  
  2496. //
  2497. //  Helper function which returns a IShellFolder interface to the desktop
  2498. // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
  2499. //
  2500. //  CoCreateInstance(CLSID_Desktop, NULL,
  2501. //                   CLSCTX_INPROC, IID_IShellFolder, &pshf);
  2502. //
  2503. WINSHELLAPI HRESULT WINAPI SHGetDesktopFolder(LPSHELLFOLDER *ppshf);
  2504.  
  2505.  
  2506. //==========================================================================
  2507. // IInputObjectSite/IInputObject interfaces
  2508. //
  2509. //  These interfaces allow us (or ISVs) to install/update external Internet
  2510. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2511. // registry (to be defined) and CoCreateInstance it.
  2512. //
  2513. //==========================================================================
  2514.  
  2515. //-------------------------------------------------------------------------
  2516. //
  2517. // IInputObjectSite interface
  2518. //
  2519. //   A site implements this interface so the object can communicate
  2520. // focus change to it.
  2521. //
  2522. // [Member functions]
  2523. //
  2524. // IInputObjectSite::OnFocusChangeIS(punkObj, fSetFocus)
  2525. //   Object (punkObj) is getting or losing the focus.  
  2526. //
  2527. //-------------------------------------------------------------------------
  2528.  
  2529.  
  2530. #undef  INTERFACE
  2531. #define INTERFACE   IInputObjectSite
  2532.  
  2533. DECLARE_INTERFACE_(IInputObjectSite, IUnknown)
  2534. {
  2535.     // *** IUnknown methods ***
  2536.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2537.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2538.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2539.  
  2540.     // *** IInputObjectSite specific methods ***
  2541.     STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus) PURE;
  2542. };
  2543.  
  2544.  
  2545. //-------------------------------------------------------------------------
  2546. //
  2547. // IInputObject interface
  2548. //
  2549. //   An object implements this interface so the site can communicate
  2550. // activation and accelerator events to it.
  2551. //
  2552. // [Member functions]
  2553. //
  2554. // IInputObject::UIActivateIO(fActivate, lpMsg)
  2555. //   Activates or deactivates the object.  lpMsg may be NULL.  Returns
  2556. //   S_OK if the activation succeeded.
  2557. //
  2558. // IInputObject::HasFocusIO()
  2559. //   Returns S_OK if the object has the focus, S_FALSE if not.
  2560. //
  2561. // IInputObject::TranslateAcceleratorIO(lpMsg)
  2562. //   Allow the object to process the message.  Returns S_OK if the 
  2563. //   message was processed (eaten).
  2564. //
  2565. //-------------------------------------------------------------------------
  2566.  
  2567.  
  2568. #undef  INTERFACE
  2569. #define INTERFACE   IInputObject
  2570.  
  2571. DECLARE_INTERFACE_(IInputObject, IUnknown)
  2572. {
  2573.     // *** IUnknown methods ***
  2574.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2575.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2576.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2577.  
  2578.     // *** IInputObject specific methods ***
  2579.     STDMETHOD(UIActivateIO)(THIS_ BOOL fActivate, LPMSG lpMsg) PURE;
  2580.     STDMETHOD(HasFocusIO)(THIS) PURE;
  2581.     STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
  2582. };
  2583.  
  2584.  
  2585. //==========================================================================
  2586. // IDockingWindowSite/IDockingWindow/IDockingWindowFrame interfaces
  2587. // IInputObjectSite/IInputObject interfaces
  2588. //
  2589. //  These interfaces allow us (or ISVs) to install/update external Internet
  2590. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2591. // registry (to be defined) and CoCreateInstance it.
  2592. //
  2593. //==========================================================================
  2594.  
  2595.  
  2596. //-------------------------------------------------------------------------
  2597. //
  2598. // IDockingWindowSite interface
  2599. //
  2600. //   A site implements this interface so the object can negotiate for
  2601. // and inquire about real estate on the site.
  2602. //
  2603. // [Member functions]
  2604. //
  2605. // IDockingWindowSite::GetBorderDW(punkObj, prcBorder)
  2606. //   Site returns the bounding rectangle of the given source object 
  2607. //   (punkObj).
  2608. //
  2609. // IDockingWindowSite::RequestBorderSpaceDW(punkObj, pbw)
  2610. //   Object requests that the site makes room for it, as specified in
  2611. //   *pbw.
  2612. //
  2613. // IDockingWindowSite::SetBorderSpaceDW(punkObj, pbw)
  2614. //   Object requests that the site set the border spacing to the size 
  2615. //   specified in *pbw.
  2616. //
  2617. //-------------------------------------------------------------------------
  2618.  
  2619.  
  2620. #undef  INTERFACE
  2621. #define INTERFACE   IDockingWindowSite
  2622.  
  2623. DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
  2624. {
  2625.     // *** IUnknown methods ***
  2626.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2627.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2628.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2629.  
  2630.     // *** IOleWindow methods ***
  2631.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2632.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2633.  
  2634.     // *** IDockingWindowSite methods ***
  2635.     STDMETHOD(GetBorderDW) (THIS_ IUnknown* punkObj, LPRECT prcBorder) PURE;
  2636.     STDMETHOD(RequestBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2637.     STDMETHOD(SetBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2638. };
  2639.  
  2640.  
  2641.  
  2642. //-------------------------------------------------------------------------
  2643. //
  2644. // IDockingWindowFrame interface
  2645. //
  2646. //
  2647. // [Member functions]
  2648. //
  2649. // IDockingWindowFrame::AddToolbar(punkSrc, pwszItem, dwReserved)
  2650. //
  2651. // IDockingWindowFrame::RemoveToolbar(punkSrc, dwRemoveFlags)
  2652. //
  2653. // IDockingWindowFrame::FindToolbar(pwszItem, riid, ppvObj)
  2654. //
  2655. //-------------------------------------------------------------------------
  2656.  
  2657.  
  2658. // flags for RemoveToolbar
  2659. #define DWFRF_NORMAL            0x0000
  2660. #define DWFRF_DELETECONFIGDATA  0x0001
  2661.  
  2662.  
  2663. // flags for AddToolbar
  2664. #define DWFAF_HIDDEN  0x0001   // add hidden
  2665.  
  2666. #undef  INTERFACE
  2667. #define INTERFACE   IDockingWindowFrame
  2668.  
  2669. DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
  2670. {
  2671.     // *** IUnknown methods ***
  2672.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2673.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2674.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2675.  
  2676.     // *** IOleWindow methods ***
  2677.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2678.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2679.  
  2680.     // *** IDockingWindowFrame methods ***
  2681.     STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
  2682.     STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
  2683.     STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, LPVOID* ppvObj) PURE;
  2684. };
  2685.  
  2686.  
  2687.  
  2688. //-------------------------------------------------------------------------
  2689. //
  2690. // IDockingWindow interface
  2691. //
  2692. //   An object (docking window) implements this interface so the site can 
  2693. // communicate with it.  An example of a docking window is a toolbar.
  2694. //
  2695. // [Member functions]
  2696. //
  2697. // IDockingWindow::ShowDW(fShow)
  2698. //   Shows or hides the docking window.
  2699. //
  2700. // IDockingWindow::CloseDW(dwReserved)
  2701. //   Closes the docking window.  dwReserved must be 0.
  2702. //
  2703. // IDockingWindow::ResizeBorderDW(prcBorder, punkToolbarSite, fReserved)
  2704. //   Resizes the docking window's border to *prcBorder.  fReserved must
  2705. //   be 0.
  2706. // IObjectWithSite::SetSite(punkSite)
  2707. //   IDockingWindow usually paired with IObjectWithSite.
  2708. //   Provides the IUnknown pointer of the site to the docking window.
  2709. //
  2710. //
  2711. //-------------------------------------------------------------------------
  2712.  
  2713.  
  2714. #undef  INTERFACE
  2715. #define INTERFACE   IDockingWindow
  2716.  
  2717. DECLARE_INTERFACE_(IDockingWindow, IOleWindow)
  2718. {
  2719.     // *** IUnknown methods ***
  2720.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2721.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2722.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2723.  
  2724.     // *** IOleWindow methods ***
  2725.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2726.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2727.  
  2728.     // *** IDockingWindow methods ***
  2729.     STDMETHOD(ShowDW)         (THIS_ BOOL fShow) PURE;
  2730.     STDMETHOD(CloseDW)        (THIS_ DWORD dwReserved) PURE;
  2731.     STDMETHOD(ResizeBorderDW) (THIS_ LPCRECT   prcBorder,
  2732.                                      IUnknown* punkToolbarSite,
  2733.                                      BOOL      fReserved) PURE;
  2734. };
  2735.  
  2736.  
  2737. //-------------------------------------------------------------------------
  2738. //
  2739. // IDeskBand interface
  2740. //
  2741. //
  2742. // [Member functions]
  2743. //
  2744. // IDeskBand::GetBandInfo(dwBandID, dwViewMode, pdbi)
  2745. //   Returns info on the given band in *pdbi, according to the mask
  2746. //   field in the DESKBANDINFO structure and the given viewmode.
  2747. //
  2748. //-------------------------------------------------------------------------
  2749.  
  2750.  
  2751. // Mask values for DESKBANDINFO
  2752. #define DBIM_MINSIZE    0x0001
  2753. #define DBIM_MAXSIZE    0x0002
  2754. #define DBIM_INTEGRAL   0x0004
  2755. #define DBIM_ACTUAL     0x0008
  2756. #define DBIM_TITLE      0x0010
  2757. #define DBIM_MODEFLAGS  0x0020
  2758. #define DBIM_BKCOLOR    0x0040
  2759.  
  2760. typedef struct {
  2761.     DWORD       dwMask;
  2762.     POINTL      ptMinSize;
  2763.     POINTL      ptMaxSize;
  2764.     POINTL      ptIntegral;
  2765.     POINTL      ptActual;
  2766.     WCHAR       wszTitle[256];
  2767.     DWORD       dwModeFlags;
  2768.     COLORREF    crBkgnd;
  2769. } DESKBANDINFO;
  2770.  
  2771. // DESKBANDINFO dwModeFlags values
  2772. #define DBIMF_NORMAL            0x0000
  2773. #define DBIMF_VARIABLEHEIGHT    0x0008
  2774. #define DBIMF_DEBOSSED          0x0020
  2775. #define DBIMF_BKCOLOR           0x0040
  2776.  
  2777. // GetBandInfo view mode values 
  2778. #define DBIF_VIEWMODE_NORMAL         0x0000
  2779. #define DBIF_VIEWMODE_VERTICAL       0x0001
  2780. #define DBIF_VIEWMODE_FLOATING       0x0002
  2781. #define DBIF_VIEWMODE_TRANSPARENT    0x0004
  2782.  
  2783.  
  2784. #undef  INTERFACE
  2785. #define INTERFACE   IDeskBand
  2786.  
  2787. DECLARE_INTERFACE_(IDeskBand, IDockingWindow)
  2788. {
  2789.     // *** IUnknown methods ***
  2790.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2791.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2792.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2793.  
  2794.     // *** IOleWindow methods ***
  2795.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2796.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2797.  
  2798.     // *** IDockingWindow methods ***
  2799.     STDMETHOD(ShowDW)         (THIS_ BOOL fShow) PURE;
  2800.     STDMETHOD(CloseDW)        (THIS_ DWORD dwReserved) PURE;
  2801.     STDMETHOD(ResizeBorderDW) (THIS_ LPCRECT   prcBorder,
  2802.                                      IUnknown* punkToolbarSite,
  2803.                                      BOOL      fReserved) PURE;
  2804.     // *** IDeskBand methods ***
  2805.     STDMETHOD(GetBandInfo)    (THIS_ DWORD dwBandID, DWORD dwViewMode, 
  2806.                                 DESKBANDINFO* pdbi) PURE;
  2807.  
  2808. };
  2809.  
  2810. // Command Target IDs
  2811. enum {
  2812.     DBID_BANDINFOCHANGED = 0,
  2813.     // 
  2814.     DBID_SHOWONLY = 1,         
  2815.     DBID_MAXIMIZEBAND,      // Maximize the specified band (VT_UI4 == dwID)
  2816. };
  2817.  
  2818.  
  2819.  
  2820. #if (_WIN32_IE >= 0x400)
  2821. //
  2822. // We need to make sure that WININET.H is included before this interface is
  2823. // used because the COMPONENT structure uses INTERNET_MAX_URL_LENGTH
  2824. //
  2825. #ifdef _WININET_
  2826. //
  2827. //  Flags and structures used by IActiveDesktop
  2828. //
  2829.  
  2830. typedef struct _tagWALLPAPEROPT
  2831. {
  2832.     DWORD   dwSize;     // size of this Structure.
  2833.     DWORD   dwStyle;    // WPSTYLE_* mentioned above
  2834. }
  2835. WALLPAPEROPT;
  2836.  
  2837. typedef WALLPAPEROPT  *LPWALLPAPEROPT;
  2838. typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
  2839.  
  2840. typedef struct _tagCOMPONENTSOPT
  2841. {
  2842.     DWORD   dwSize;             //Size of this structure
  2843.     BOOL    fEnableComponents;  //Enable components?
  2844.     BOOL    fActiveDesktop;     // Active desktop enabled ?
  2845. }
  2846. COMPONENTSOPT;
  2847.  
  2848. typedef COMPONENTSOPT   *LPCOMPONENTSOPT;
  2849. typedef const COMPONENTSOPT   *LPCCOMPONENTSOPT;
  2850.  
  2851. typedef struct _tagCOMPPOS
  2852. {
  2853.     DWORD   dwSize;             //Size of this structure
  2854.     int     iLeft;              //Left of top-left corner in screen co-ordinates.
  2855.     int     iTop;               //Top of top-left corner in screen co-ordinates.
  2856.     DWORD   dwWidth;            // Width in pixels.
  2857.     DWORD   dwHeight;           // Height in pixels.
  2858.     int     izIndex;            // Indicates the Z-order of the component.
  2859.     BOOL    fCanResize;         // Is the component resizeable?
  2860.     BOOL    fCanResizeX;        // Resizeable in X-direction?
  2861.     BOOL    fCanResizeY;        // Resizeable in Y-direction?
  2862.     int     iPreferredLeftPercent;    //Left of top-left corner as percent of screen width
  2863.     int     iPreferredTopPercent;     //Top of top-left corner as percent of screen height
  2864. }
  2865. COMPPOS;
  2866.  
  2867. typedef COMPPOS *LPCOMPPOS;
  2868. typedef const COMPPOS *LPCCOMPPOS;
  2869.  
  2870.  
  2871.  
  2872.  
  2873. #define COMPONENT_TOP (0x7fffffff)  // izOrder value meaning component is at the top
  2874.  
  2875.  
  2876. // iCompType values
  2877. #define COMP_TYPE_HTMLDOC       0
  2878. #define COMP_TYPE_PICTURE       1
  2879. #define COMP_TYPE_WEBSITE       2
  2880. #define COMP_TYPE_CONTROL       3
  2881. #define COMP_TYPE_CFHTML        4
  2882. #define COMP_TYPE_MAX           4
  2883.  
  2884. typedef struct _tagCOMPONENT
  2885. {
  2886.     DWORD   dwSize;             //Size of this structure
  2887.     DWORD   dwID;               //Reserved: Set it always to zero.
  2888.     int     iComponentType;     //One of COMP_TYPE_*
  2889.     BOOL    fChecked;           // Is this component enabled? 
  2890.     BOOL    fDirty;             // Had the component been modified and not yet saved to disk?
  2891.     BOOL    fNoScroll;          // Is the component scrollable?
  2892.     COMPPOS cpPos;              // Width, height etc.,
  2893.     WCHAR   wszFriendlyName[MAX_PATH];          // Friendly name of component.
  2894.     WCHAR   wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  2895.     WCHAR   wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  2896. }
  2897. COMPONENT;
  2898.  
  2899. typedef COMPONENT *LPCOMPONENT;
  2900. typedef const COMPONENT *LPCCOMPONENT;
  2901.  
  2902.  
  2903.  
  2904.  
  2905. ////////////////////////////////////////////
  2906. // Flags for IActiveDesktop::ApplyChanges()
  2907. #define AD_APPLY_SAVE         0x00000001
  2908. #define AD_APPLY_HTMLGEN      0x00000002
  2909. #define AD_APPLY_REFRESH      0x00000004
  2910. #define AD_APPLY_ALL     (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)
  2911. #define AD_APPLY_FORCE        0x00000008
  2912. #define AD_APPLY_BUFFERED_REFRESH 0x00000010
  2913.  
  2914. ////////////////////////////////////////////
  2915. // Flags for IActiveDesktop::GetWallpaperOptions()
  2916. //           IActiveDesktop::SetWallpaperOptions()
  2917. #define WPSTYLE_CENTER      0
  2918. #define WPSTYLE_TILE        1
  2919. #define WPSTYLE_STRETCH     2
  2920. #define WPSTYLE_MAX         3
  2921.  
  2922.  
  2923. ////////////////////////////////////////////
  2924. // Flags for IActiveDesktop::ModifyComponent()
  2925.  
  2926. #define COMP_ELEM_TYPE          0x00000001
  2927. #define COMP_ELEM_CHECKED       0x00000002
  2928. #define COMP_ELEM_DIRTY         0x00000004
  2929. #define COMP_ELEM_NOSCROLL      0x00000008
  2930. #define COMP_ELEM_POS_LEFT      0x00000010
  2931. #define COMP_ELEM_POS_TOP       0x00000020
  2932. #define COMP_ELEM_SIZE_WIDTH    0x00000040
  2933. #define COMP_ELEM_SIZE_HEIGHT   0x00000080
  2934. #define COMP_ELEM_POS_ZINDEX    0x00000100
  2935. #define COMP_ELEM_SOURCE        0x00000200
  2936. #define COMP_ELEM_FRIENDLYNAME  0x00000400
  2937. #define COMP_ELEM_SUBSCRIBEDURL 0x00000800
  2938.  
  2939. #define COMP_ELEM_ALL   (COMP_ELEM_TYPE | COMP_ELEM_CHECKED | COMP_ELEM_DIRTY |          \
  2940.                          COMP_ELEM_NOSCROLL | COMP_ELEM_POS_LEFT | COMP_ELEM_SIZE_WIDTH  \
  2941.                          COMP_ELEM_SIZE_HEIGHT | COMP_ELEM_POS_ZINDEX | COMP_ELEM_SOURCE \
  2942.                          COMP_ELEM_FRIENDLYNAME )
  2943.  
  2944.  
  2945. ////////////////////////////////////////////
  2946. // Flags for IActiveDesktop::AddDesktopItemWithUI()
  2947. typedef enum tagDTI_ADTIWUI
  2948. {
  2949.     DTI_ADDUI_DEFAULT               = 0x00000000,
  2950.     DTI_ADDUI_DISPSUBWIZARD         = 0x00000001,
  2951. } DTI_ADTIWUI;
  2952.  
  2953.  
  2954. ////////////////////////////////////////////
  2955. // Flags for IActiveDesktop::AddUrl()
  2956. #define ADDURL_SILENT           0X0001
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962. //
  2963. //  Interface for manipulating the Active Desktop.
  2964. //
  2965.  
  2966. #undef INTERFACE
  2967. #define INTERFACE IActiveDesktop
  2968.  
  2969. DECLARE_INTERFACE_( IActiveDesktop, IUnknown )
  2970. {
  2971.     // IUnknown methods
  2972.     STDMETHOD (QueryInterface)(THIS_ REFIID riid, void ** ppv) PURE;
  2973.     STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2974.     STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2975.  
  2976.     // IActiveDesktop methods
  2977.     STDMETHOD (ApplyChanges)(THIS_ DWORD dwFlags) PURE;
  2978.     STDMETHOD (GetWallpaper)(THIS_ LPWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwReserved) PURE;
  2979.     STDMETHOD (SetWallpaper)(THIS_ LPCWSTR pwszWallpaper, DWORD dwReserved) PURE;
  2980.     STDMETHOD (GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2981.     STDMETHOD (SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2982.     STDMETHOD (GetPattern)(THIS_ LPWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
  2983.     STDMETHOD (SetPattern)(THIS_ LPCWSTR pwszPattern, DWORD dwReserved) PURE;
  2984.     STDMETHOD (GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2985.     STDMETHOD (SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2986.     STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2987.     STDMETHOD (AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2988.     STDMETHOD (ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
  2989.     STDMETHOD (RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2990.     STDMETHOD (GetDesktopItemCount)(THIS_ LPINT lpiCount, DWORD dwReserved) PURE;
  2991.     STDMETHOD (GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2992.     STDMETHOD (GetDesktopItemByID)(THIS_ DWORD dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2993.     STDMETHOD (GenerateDesktopItemHtml)(THIS_ LPCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2994.     STDMETHOD (AddUrl)(THIS_ HWND hwnd, LPCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
  2995.     STDMETHOD (GetDesktopItemBySource)(THIS_ LPCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2996. };
  2997.  
  2998. typedef IActiveDesktop * LPACTIVEDESKTOP;
  2999.  
  3000.  
  3001. #endif // _WININET_
  3002.  
  3003. #endif // _WIN32_IE
  3004.  
  3005. //==========================================================================
  3006. // Clipboard format which may be supported by IDataObject from system
  3007. // defined shell folders (such as directories, network, ...).
  3008. //==========================================================================
  3009.  
  3010. #define CFSTR_SHELLIDLIST       TEXT("Shell IDList Array")      // CF_IDLIST
  3011. #define CFSTR_SHELLIDLISTOFFSET TEXT("Shell Object Offsets")    // CF_OBJECTPOSITIONS
  3012. #define CFSTR_NETRESOURCES      TEXT("Net Resource")            // CF_NETRESOURCE
  3013. #define CFSTR_FILEDESCRIPTORA   TEXT("FileGroupDescriptor")     // CF_FILEGROUPDESCRIPTORA
  3014. #define CFSTR_FILEDESCRIPTORW   TEXT("FileGroupDescriptorW")    // CF_FILEGROUPDESCRIPTORW
  3015. #define CFSTR_FILECONTENTS      TEXT("FileContents")            // CF_FILECONTENTS
  3016. #define CFSTR_FILENAMEA         TEXT("FileName")                // CF_FILENAMEA
  3017. #define CFSTR_FILENAMEW         TEXT("FileNameW")               // CF_FILENAMEW
  3018. #define CFSTR_PRINTERGROUP      TEXT("PrinterFriendlyName")     // CF_PRINTERS
  3019. #define CFSTR_FILENAMEMAPA      TEXT("FileNameMap")             // CF_FILENAMEMAPA
  3020. #define CFSTR_FILENAMEMAPW      TEXT("FileNameMapW")            // CF_FILENAMEMAPW
  3021. #define CFSTR_SHELLURL          TEXT("UniformResourceLocator")
  3022. #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
  3023. #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect") 
  3024. #define CFSTR_PASTESUCCEEDED    TEXT("Paste Succeeded")
  3025. #define CFSTR_INDRAGLOOP        TEXT("InShellDragLoop")
  3026.  
  3027. #ifdef UNICODE
  3028. #define CFSTR_FILEDESCRIPTOR    CFSTR_FILEDESCRIPTORW
  3029. #define CFSTR_FILENAME          CFSTR_FILENAMEW
  3030. #define CFSTR_FILENAMEMAP       CFSTR_FILENAMEMAPW
  3031. #else
  3032. #define CFSTR_FILEDESCRIPTOR    CFSTR_FILEDESCRIPTORA
  3033. #define CFSTR_FILENAME          CFSTR_FILENAMEA
  3034. #define CFSTR_FILENAMEMAP       CFSTR_FILENAMEMAPA
  3035. #endif
  3036.  
  3037. //
  3038. // CF_OBJECTPOSITIONS
  3039. //
  3040. //
  3041.  
  3042.  
  3043.  
  3044. #define DVASPECT_SHORTNAME      2 // use for CF_HDROP to get short name version
  3045. //
  3046. // format of CF_NETRESOURCE
  3047. //
  3048. typedef struct _NRESARRAY {     // anr
  3049.     UINT cItems;
  3050.     NETRESOURCE nr[1];
  3051. } NRESARRAY, * LPNRESARRAY;
  3052.  
  3053. //
  3054. // format of CF_IDLIST
  3055. //
  3056. typedef struct _IDA {
  3057.     UINT cidl;          // number of relative IDList
  3058.     UINT aoffset[1];    // [0]: folder IDList, [1]-[cidl]: item IDList
  3059. } CIDA, * LPIDA;
  3060.  
  3061. //
  3062. // FILEDESCRIPTOR.dwFlags field indicate which fields are to be used
  3063. //
  3064. typedef enum {
  3065.     FD_CLSID            = 0x0001,
  3066.     FD_SIZEPOINT        = 0x0002,
  3067.     FD_ATTRIBUTES       = 0x0004,
  3068.     FD_CREATETIME       = 0x0008,
  3069.     FD_ACCESSTIME       = 0x0010,
  3070.     FD_WRITESTIME       = 0x0020,
  3071.     FD_FILESIZE         = 0x0040,
  3072.     FD_LINKUI           = 0x8000,       // 'link' UI is prefered
  3073. } FD_FLAGS;
  3074.  
  3075. typedef struct _FILEDESCRIPTORA { // fod
  3076.     DWORD dwFlags;
  3077.  
  3078.     CLSID clsid;
  3079.     SIZEL sizel;
  3080.     POINTL pointl;
  3081.  
  3082.     DWORD dwFileAttributes;
  3083.     FILETIME ftCreationTime;
  3084.     FILETIME ftLastAccessTime;
  3085.     FILETIME ftLastWriteTime;
  3086.     DWORD nFileSizeHigh;
  3087.     DWORD nFileSizeLow;
  3088.     CHAR   cFileName[ MAX_PATH ];
  3089. } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
  3090.  
  3091. typedef struct _FILEDESCRIPTORW { // fod
  3092.     DWORD dwFlags;
  3093.  
  3094.     CLSID clsid;
  3095.     SIZEL sizel;
  3096.     POINTL pointl;
  3097.  
  3098.     DWORD dwFileAttributes;
  3099.     FILETIME ftCreationTime;
  3100.     FILETIME ftLastAccessTime;
  3101.     FILETIME ftLastWriteTime;
  3102.     DWORD nFileSizeHigh;
  3103.     DWORD nFileSizeLow;
  3104.     WCHAR  cFileName[ MAX_PATH ];
  3105. } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
  3106.  
  3107. #ifdef UNICODE
  3108. #define FILEDESCRIPTOR      FILEDESCRIPTORW
  3109. #define LPFILEDESCRIPTOR    LPFILEDESCRIPTORW
  3110. #else
  3111. #define FILEDESCRIPTOR      FILEDESCRIPTORA
  3112. #define LPFILEDESCRIPTOR    LPFILEDESCRIPTORA
  3113. #endif
  3114.  
  3115. //
  3116. // format of CF_FILEGROUPDESCRIPTOR
  3117. //
  3118. typedef struct _FILEGROUPDESCRIPTORA { // fgd
  3119.      UINT cItems;
  3120.      FILEDESCRIPTORA fgd[1];
  3121. } FILEGROUPDESCRIPTORA, * LPFILEGROUPDESCRIPTORA;
  3122.  
  3123. typedef struct _FILEGROUPDESCRIPTORW { // fgd
  3124.      UINT cItems;
  3125.      FILEDESCRIPTORW fgd[1];
  3126. } FILEGROUPDESCRIPTORW, * LPFILEGROUPDESCRIPTORW;
  3127.  
  3128. #ifdef UNICODE
  3129. #define FILEGROUPDESCRIPTOR     FILEGROUPDESCRIPTORW
  3130. #define LPFILEGROUPDESCRIPTOR   LPFILEGROUPDESCRIPTORW
  3131. #else
  3132. #define FILEGROUPDESCRIPTOR     FILEGROUPDESCRIPTORA
  3133. #define LPFILEGROUPDESCRIPTOR   LPFILEGROUPDESCRIPTORA
  3134. #endif
  3135.  
  3136. //
  3137. // format of CF_HDROP and CF_PRINTERS, in the HDROP case the data that follows
  3138. // is a double null terinated list of file names, for printers they are printer
  3139. // friendly names
  3140. //
  3141. typedef struct _DROPFILES {
  3142.    DWORD pFiles;                       // offset of file list
  3143.    POINT pt;                           // drop point (client coords)
  3144.    BOOL fNC;                           // is it on NonClient area
  3145.                                        // and pt is in screen coords
  3146.    BOOL fWide;                         // WIDE character switch
  3147. } DROPFILES, FAR * LPDROPFILES;
  3148.  
  3149.  
  3150. //====== File System Notification APIs ===============================
  3151. //
  3152.  
  3153. //
  3154. //  File System Notification flags
  3155. //
  3156.  
  3157. #define SHCNE_RENAMEITEM          0x00000001L
  3158. #define SHCNE_CREATE              0x00000002L
  3159. #define SHCNE_DELETE              0x00000004L
  3160. #define SHCNE_MKDIR               0x00000008L
  3161. #define SHCNE_RMDIR               0x00000010L
  3162. #define SHCNE_MEDIAINSERTED       0x00000020L
  3163. #define SHCNE_MEDIAREMOVED        0x00000040L
  3164. #define SHCNE_DRIVEREMOVED        0x00000080L
  3165. #define SHCNE_DRIVEADD            0x00000100L
  3166. #define SHCNE_NETSHARE            0x00000200L
  3167. #define SHCNE_NETUNSHARE          0x00000400L
  3168. #define SHCNE_ATTRIBUTES          0x00000800L
  3169. #define SHCNE_UPDATEDIR           0x00001000L
  3170. #define SHCNE_UPDATEITEM          0x00002000L
  3171. #define SHCNE_SERVERDISCONNECT    0x00004000L
  3172. #define SHCNE_UPDATEIMAGE         0x00008000L
  3173. #define SHCNE_DRIVEADDGUI         0x00010000L
  3174. #define SHCNE_RENAMEFOLDER        0x00020000L
  3175. #define SHCNE_FREESPACE           0x00040000L
  3176.  
  3177. #if (_WIN32_IE >= 0x0400)
  3178. #define SHCNE_EXTENDED_EVENT      0x04000000L
  3179. #endif      // _WIN32_IE >= 0x0400
  3180.  
  3181. #define SHCNE_ASSOCCHANGED        0x08000000L
  3182.  
  3183. #define SHCNE_DISKEVENTS          0x0002381FL
  3184. #define SHCNE_GLOBALEVENTS        0x0C0581E0L // Events that dont match pidls first
  3185. #define SHCNE_ALLEVENTS           0x7FFFFFFFL
  3186. #define SHCNE_INTERRUPT           0x80000000L // The presence of this flag indicates
  3187.                                             // that the event was generated by an
  3188.                                             // interrupt.  It is stripped out before
  3189.                                             // the clients of SHCNNotify_ see it.
  3190.  
  3191. #if (_WIN32_IE >= 0x0400)
  3192. #define SHCNEE_ORDERCHANGED       0x00000002L  // dwItem2 is the pidl of the changed folder
  3193. #endif
  3194.  
  3195.  
  3196. // Flags
  3197. // uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
  3198. #define SHCNF_IDLIST      0x0000        // LPITEMIDLIST
  3199. #define SHCNF_PATHA       0x0001        // path name
  3200. #define SHCNF_PRINTERA    0x0002        // printer friendly name
  3201. #define SHCNF_DWORD       0x0003        // DWORD
  3202. #define SHCNF_PATHW       0x0005        // path name
  3203. #define SHCNF_PRINTERW    0x0006        // printer friendly name
  3204. #define SHCNF_TYPE        0x00FF
  3205. #define SHCNF_FLUSH       0x1000
  3206. #define SHCNF_FLUSHNOWAIT 0x2000
  3207.  
  3208. #ifdef UNICODE
  3209. #define SHCNF_PATH      SHCNF_PATHW
  3210. #define SHCNF_PRINTER   SHCNF_PRINTERW
  3211. #else
  3212. #define SHCNF_PATH      SHCNF_PATHA
  3213. #define SHCNF_PRINTER   SHCNF_PRINTERA
  3214. #endif
  3215.  
  3216.  
  3217. //
  3218. //  APIs
  3219. //
  3220. WINSHELLAPI void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags,
  3221.                                 LPCVOID dwItem1, LPCVOID dwItem2);
  3222.  
  3223. //
  3224. // IShellChangeNotify
  3225. //
  3226. #undef  INTERFACE
  3227. #define INTERFACE  IShellChangeNotify
  3228.  
  3229. DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
  3230. {
  3231.     // *** IUnknown methods ***
  3232.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  3233.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  3234.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  3235.  
  3236.     // *** IShellChangeNotify methods ***
  3237.     STDMETHOD(OnChange) (THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3238. } ;
  3239.  
  3240. //
  3241. // IQueryInfo
  3242. //
  3243. #undef  INTERFACE
  3244. #define INTERFACE  IQueryInfo
  3245.  
  3246. DECLARE_INTERFACE_(IQueryInfo, IUnknown)
  3247. {
  3248.     // *** IUnknown methods ***
  3249.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  3250.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  3251.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  3252.  
  3253.     // *** IQueryInfo methods ***
  3254.     STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR **ppwszTip) PURE;
  3255.     STDMETHOD(GetInfoFlags)(THIS_ DWORD *pdwFlags) PURE;
  3256. } ;
  3257.  
  3258.  
  3259. #define QIF_CACHED           0x00000001
  3260. #define QIF_DONTEXPANDFOLDER 0x00000002
  3261.  
  3262.  
  3263. //
  3264. // SHAddToRecentDocs
  3265. //
  3266. #define SHARD_PIDL      0x00000001L
  3267. #define SHARD_PATHA     0x00000002L
  3268. #define SHARD_PATHW     0x00000003L
  3269.  
  3270. #ifdef UNICODE
  3271. #define SHARD_PATH  SHARD_PATHW
  3272. #else
  3273. #define SHARD_PATH  SHARD_PATHA
  3274. #endif
  3275.  
  3276. WINSHELLAPI void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  3277.  
  3278. WINSHELLAPI HRESULT WINAPI SHGetInstanceExplorer(IUnknown **ppunk);
  3279.  
  3280. //
  3281. // SHGetDataFromIDListA/W
  3282. //
  3283. #define SHGDFIL_FINDDATA        1
  3284. #define SHGDFIL_NETRESOURCE     2
  3285. #define SHGDFIL_DESCRIPTIONID   3
  3286.  
  3287. #define SHDID_ROOT_REGITEM          1
  3288. #define SHDID_FS_FILE               2
  3289. #define SHDID_FS_DIRECTORY          3
  3290. #define SHDID_FS_OTHER              4
  3291. #define SHDID_COMPUTER_DRIVE35      5
  3292. #define SHDID_COMPUTER_DRIVE525     6
  3293. #define SHDID_COMPUTER_REMOVABLE    7
  3294. #define SHDID_COMPUTER_FIXED        8
  3295. #define SHDID_COMPUTER_NETDRIVE     9
  3296. #define SHDID_COMPUTER_CDROM        10
  3297. #define SHDID_COMPUTER_RAMDISK      11
  3298. #define SHDID_COMPUTER_OTHER        12
  3299. #define SHDID_NET_DOMAIN            13
  3300. #define SHDID_NET_SERVER            14
  3301. #define SHDID_NET_SHARE             15
  3302. #define SHDID_NET_RESTOFNET         16
  3303. #define SHDID_NET_OTHER             17
  3304.  
  3305. typedef struct _SHDESCRIPTIONID {
  3306.     DWORD   dwDescriptionId;
  3307.     CLSID   clsid;
  3308. } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
  3309.  
  3310. WINSHELLAPI HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
  3311.         int nFormat, PVOID pv, int cb);
  3312. WINSHELLAPI HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
  3313.         int nFormat, PVOID pv, int cb);
  3314.  
  3315. #ifdef UNICODE
  3316. #define SHGetDataFromIDList SHGetDataFromIDListW
  3317. #else
  3318. #define SHGetDataFromIDList SHGetDataFromIDListA
  3319. #endif
  3320.  
  3321.  
  3322. //===========================================================================
  3323.  
  3324.  
  3325. //
  3326. // PROPIDs for Internet Shortcuts (FMTID_Intshcut) to be used with 
  3327. // IPropertySetStorage/IPropertyStorage
  3328. //
  3329. // The known property ids and their variant types are:
  3330. //      PID_IS_URL          [VT_LPWSTR]   URL
  3331. //      PID_IS_NAME         [VT_LPWSTR]   Name of the internet shortcut
  3332. //      PID_IS_WORKINGDIR   [VT_LPWSTR]   Working directory for the shortcut
  3333. //      PID_IS_HOTKEY       [VT_UI2]      Hotkey for the shortcut
  3334. //      PID_IS_SHOWCMD      [VT_I4]       Show command for shortcut
  3335. //      PID_IS_ICONINDEX    [VT_I4]       Index into file that has icon
  3336. //      PID_IS_ICONFILE     [VT_LPWSTR]   File that has the icon
  3337. //      PID_IS_WHATSNEW     [VT_LPWSTR]   What's New text
  3338. //      PID_IS_AUTHOR       [VT_LPWSTR]   Author
  3339. //      PID_IS_DESCRIPTION  [VT_LPWSTR]   Description text of site
  3340. //      PID_IS_COMMENT      [VT_LPWSTR]   User annotated comment
  3341. //
  3342.  
  3343. #define PID_IS_URL           2
  3344. #define PID_IS_NAME          4
  3345. #define PID_IS_WORKINGDIR    5
  3346. #define PID_IS_HOTKEY        6
  3347. #define PID_IS_SHOWCMD       7
  3348. #define PID_IS_ICONINDEX     8
  3349. #define PID_IS_ICONFILE      9
  3350. #define PID_IS_WHATSNEW      10
  3351. #define PID_IS_AUTHOR        11
  3352. #define PID_IS_DESCRIPTION   12
  3353. #define PID_IS_COMMENT       13
  3354.  
  3355. //
  3356. // PROPIDs for Internet Sites (FMTID_InternetSite) to be used with 
  3357. // IPropertySetStorage/IPropertyStorage
  3358. //
  3359. // The known property ids and their variant types are:
  3360. //      PID_INTSITE_WHATSNEW     [VT_LPWSTR]   What's New text
  3361. //      PID_INTSITE_AUTHOR       [VT_LPWSTR]   Author
  3362. //      PID_INTSITE_LASTVISIT    [VT_FILETIME] Time site was last visited
  3363. //      PID_INTSITE_LASTMOD      [VT_FILETIME] Time site was last modified
  3364. //      PID_INTSITE_VISITCOUNT   [VT_UI4]      Number of times user has visited
  3365. //      PID_INTSITE_DESCRIPTION  [VT_LPWSTR]   Description text of site
  3366. //      PID_INTSITE_COMMENT      [VT_LPWSTR]   User annotated comment
  3367. //      PID_INTSITE_RECURSE      [VT_UI4]      Levels to recurse (0-3)
  3368. //      PID_INTSITE_WATCH        [VT_UI4]      PIDISM_ flags
  3369. //      PID_INTSITE_SUBSCRIPTION [VT_UI8]      Subscription cookie
  3370. //      PID_INTSITE_URL          [VT_LPWSTR]   URL
  3371. //      PID_INTSITE_TITLE        [VT_LPWSTR]   Title
  3372. //      PID_INTSITE_CODEPAGE     [VT_UI4]      Codepage of the document
  3373. //      PID_INTSITE_TRACKING     [VT_UI4]      Tracking
  3374. //
  3375.  
  3376.  
  3377. #define PID_INTSITE_WHATSNEW      2
  3378. #define PID_INTSITE_AUTHOR        3
  3379. #define PID_INTSITE_LASTVISIT     4
  3380. #define PID_INTSITE_LASTMOD       5
  3381. #define PID_INTSITE_VISITCOUNT    6
  3382. #define PID_INTSITE_DESCRIPTION   7
  3383. #define PID_INTSITE_COMMENT       8
  3384. #define PID_INTSITE_FLAGS         9                         
  3385. #define PID_INTSITE_CONTENTLEN    10                        
  3386. #define PID_INTSITE_CONTENTCODE   11                        
  3387. #define PID_INTSITE_RECURSE       12
  3388. #define PID_INTSITE_WATCH         13
  3389. #define PID_INTSITE_SUBSCRIPTION  14
  3390. #define PID_INTSITE_URL           15
  3391. #define PID_INTSITE_TITLE         16
  3392. #define PID_INTSITE_CODEPAGE      18
  3393. #define PID_INTSITE_TRACKING      19
  3394.  
  3395. // Flags for PID_IS_FLAGS                               
  3396. #define PIDISF_RECENTLYCHANGED  0x00000001              
  3397. #define PIDISF_CACHEDSTICKY     0x00000002              
  3398. #define PIDISF_CACHEIMAGES      0x00000010              
  3399. #define PIDISF_FOLLOWALLLINKS   0x00000020              
  3400.  
  3401. // Values for PID_INTSITE_WATCH
  3402. #define PIDISM_GLOBAL           0       // Monitor based on global setting
  3403. #define PIDISM_WATCH            1       // User says watch
  3404. #define PIDISM_DONTWATCH        2       // User says don't watch
  3405.  
  3406.  
  3407. ////////////////////////////////////////////////////////////////////
  3408. //
  3409. // The shell keeps track of some per-user state to handle display
  3410. // options that is of major interest to ISVs.
  3411. // The key one requested right now is "DoubleClickInWebView".
  3412. typedef struct {
  3413.     BOOL fShowAllObjects : 1;
  3414.     BOOL fShowExtensions : 1;
  3415.     BOOL fNoConfirmRecycle : 1;
  3416.     BOOL fShowSysFiles : 1;
  3417.     BOOL fShowCompColor : 1;
  3418.     BOOL fDoubleClickInWebView : 1;
  3419.     BOOL fDesktopHTML : 1;
  3420.     BOOL fWin95Classic : 1;
  3421.     BOOL fDontPrettyPath : 1;
  3422.     BOOL fShowAttribCol : 1;
  3423.     BOOL fMapNetDrvBtn : 1;
  3424.     BOOL fShowInfoTip : 1;
  3425.     BOOL fHideIcons : 1;
  3426.     UINT fRestFlags : 3;
  3427. } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
  3428.  
  3429. #define SSF_SHOWALLOBJECTS          0x0001
  3430. #define SSF_SHOWEXTENSIONS          0x0002
  3431. #define SSF_SHOWCOMPCOLOR           0x0008
  3432. #define SSF_SHOWSYSFILES            0x0020
  3433. #define SSF_DOUBLECLICKINWEBVIEW    0x0080
  3434. #define SSF_SHOWATTRIBCOL           0x0100
  3435. #define SSF_DESKTOPHTML             0x0200
  3436. #define SSF_WIN95CLASSIC            0x0400
  3437. #define SSF_DONTPRETTYPATH          0x0800
  3438. #define SSF_SHOWINFOTIP             0x2000
  3439. #define SSF_MAPNETDRVBUTTON         0x1000
  3440. #define SSF_NOCONFIRMRECYCLE        0x8000
  3441. #define SSF_HIDEICONS               0x4000
  3442.  
  3443.  
  3444. // SHGetSettings(LPSHELLFLAGSTATE lpss, DWORD dwMask)
  3445. //
  3446. // Specify the bits you are interested in in dwMask and they will be
  3447. // filled out in the lpss structure.
  3448. //
  3449. // When these settings change, a WM_SETTINGCHANGE message is sent
  3450. // with the string lParam value of "ShellState".
  3451. //
  3452. void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
  3453.  
  3454. #ifdef __urlmon_h__
  3455. //    NOTE: urlmon.h must be included before shlobj.h to access this function.
  3456. //
  3457. //    SoftwareUpdateMessageBox
  3458. //
  3459. //    Provides a standard message box for the alerting the user that a software
  3460. //    update is available or installed. No UI will be displayed if there is no
  3461. //    update available or if the available update version is less than or equal
  3462. //    to the Advertised update version.
  3463. //
  3464. //    hWnd                - [in] Handle of owner window
  3465. //    szDistUnit          - [in] Unique identifier string for a code distribution unit. For
  3466. //                               ActiveX controls and Active Setup installed components, this
  3467. //                               is typically a GUID string.
  3468. //    dwFlags             - [in] Must be 0.
  3469. //    psdi                - [in,out] Pointer to SOFTDISTINFO ( see URLMon.h ). May be NULL.
  3470. //                                cbSize should be initialized
  3471. //                                by the caller to sizeof(SOFTDISTINFO), dwReserved should be set to 0.
  3472. //
  3473. //    RETURNS:
  3474. //
  3475. //    IDNO     - The user chose cancel. If *pbRemind is FALSE, the caller should save the 
  3476. //               update version from the SOFTDISTINFO and pass it in as the Advertised
  3477. //               version in future calls.
  3478. //
  3479. //    IDYES    - The user has selected Update Now/About Update. The caller should navigate to
  3480. //               the SOFTDISTINFO's pszHREF to initiate the install or learn about it.
  3481. //               The caller should save the update version from the SOFTDISTINFO and pass
  3482. //               it in as the Advertised version in future calls.
  3483. //
  3484. //    IDIGNORE - There is no pending software update. Note: There is
  3485. //               no Ignore button in the standard UI. This occurs if the available
  3486. //               version is less than the installed version or is not present or if the
  3487. //               Advertised version is greater than or equal to the update version.
  3488. //
  3489. //    IDABORT  - An error occured. Call GetSoftwareUpdateInfo() for a more specific HRESULT.
  3490. //               Note: There is no Abort button in the standard UI.
  3491.  
  3492.  
  3493. SHDOCAPI_(DWORD) SoftwareUpdateMessageBox( HWND hWnd,
  3494.                                            LPCWSTR szDistUnit,
  3495.                                            DWORD dwFlags,
  3496.                                            LPSOFTDISTINFO psdi );
  3497. #endif // if __urlmon_h__
  3498.  
  3499. #ifdef __cplusplus
  3500. }
  3501.  
  3502. #endif  /* __cplusplus */
  3503.  
  3504. #ifndef RC_INVOKED
  3505. #pragma pack()
  3506. #endif  /* !RC_INVOKED */
  3507.  
  3508. #pragma option pop
  3509. #endif // _SHLOBJ_H_
  3510.